Exemplo n.º 1
0
	void GlooxCLEntry::addToPrivacyList (bool add)
	{
		const auto& jid = GetJID ();

		auto lists = Account_->GetClientConnection ()->GetPrivacyListsManager ();

		auto current = lists->GetCurrentList ();
		auto items = current.GetItems ();
		for (const auto& item : items)
		{
			if (item.GetType () != PrivacyListItem::TJid)
				continue;

			if (item.GetValue () != jid)
				continue;

			if ((item.GetAction () == PrivacyListItem::AAllow && !add) ||
				(item.GetAction () == PrivacyListItem::ADeny && add))
				return;

			if (!add)
			{
				items.removeAll (item);
				break;
			}
		}
		if (add)
			items.append (PrivacyListItem (jid, PrivacyListItem::TJid));

		if (items.size () == current.GetItems ().size ())
			return;

		current.SetItems (items);
		lists->SetList (current);
	}
Exemplo n.º 2
0
/*-------------------------------------------------------------------------*/
static CHAR *builder( INT line )
{
    INDEXPKT    *index;
    MLIST       *l;
    static CHAR  from[64], to[64], area[64];
    static CHAR  str [140];

    index = GetCurrentPkt ( line );
    l     = GetCurrentList( list, line );

    if( mode == FILE_TYPE_MSG )
    {
        strcpy( area, index -> date );
        line = index -> number;
    }

    if( mode == FILE_TYPE_PKT )
    {
        strncpy( area, index -> area ? index -> area : "<Netmail>", maxA );
        line++;
    }
        
    strncpy( from, index -> from, maxN );
    strncpy( to,   index -> to,   maxN );

    sprintf( str, "%5hu %c %-*.*s %-*.*s %-*.*s",
                 line, index -> sel, maxN, maxN, from,
                                     maxN, maxN, to,
                                     maxA, maxA, area );
    if( index -> sel != ' ' )
        l -> sel = 1;
    else
        l -> sel = 0;

    return( str );
}
Exemplo n.º 3
0
	/*
	* Class:     aflobby_CUnitSyncJNIBindings
	* Method:    GetCurrentList
	* Signature: ()Ljava/lang/String;
	*/
	JNIEXPORT jstring JNICALL Java_aflobby_CUnitSyncJNIBindings_GetCurrentList
		(JNIEnv *env, jclass myobject){
			return env->NewStringUTF(GetCurrentList());
		}