Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    r098a75b reb89823  
    132132        extern void twitter_initmodule();
    133133        extern void purple_initmodule();
     134        extern void rpc_initmodule();
    134135
    135136#ifdef WITH_MSN
     
    155156#ifdef WITH_PURPLE
    156157        purple_initmodule();
     158#endif
     159
     160#ifdef WITH_RPC
     161        rpc_initmodule();
    157162#endif
    158163
     
    307312        }
    308313
    309         if (ic->acc->flags & ACC_FLAG_LOCAL) {
     314        if ((ic->acc->flags & ACC_FLAG_LOCAL_CONTACTS) &&
     315            !(ic->flags & OPT_LOCAL_CONTACTS_SENT) &&
     316            ic->acc->prpl->add_buddy) {
    310317                GHashTableIter nicks;
    311                 gpointer k, v;
     318                gpointer handle;
    312319                g_hash_table_iter_init(&nicks, ic->acc->nicks);
    313                 while (g_hash_table_iter_next(&nicks, &k, &v)) {
    314                         ic->acc->prpl->add_buddy(ic, (char *) k, NULL);
     320                while (g_hash_table_iter_next(&nicks, &handle, NULL)) {
     321                        ic->acc->prpl->add_buddy(ic, (char *) handle, NULL);
    315322                }
    316323        }
     
    492499}
    493500
     501/* Returns the local contacts for an IM account (based on assigned nicks).
     502   Linked list should be freed, the strings themselves not! So look at it
     503   like a GSList<const char*> I guess? Empty list means NULL retval (as
     504   always with GSList). */
     505GSList *imcb_get_local_contacts(struct im_connection *ic)
     506{
     507        GHashTableIter nicks;
     508        GSList *ret = NULL;
     509       
     510        if (!(ic->acc->flags & ACC_FLAG_LOCAL_CONTACTS)) {
     511                /* Only allow protocols that indicate local contact list
     512                   support to use this function. */
     513                return ret;
     514        }
     515       
     516        g_hash_table_iter_init(&nicks, ic->acc->nicks);
     517        gpointer handle;
     518        while (g_hash_table_iter_next(&nicks, &handle, NULL)) {
     519                ret = g_slist_prepend(ret, (char *) handle);
     520        }
     521       
     522        /* If the protocol asked for the list, assume we won't have to send it
     523           anymore in imcb_connected(). */
     524        ic->flags |= OPT_LOCAL_CONTACTS_SENT;
     525       
     526        return ret;
     527}
     528
    494529
    495530struct imcb_ask_cb_data {
     
    550585        struct imcb_ask_cb_data *cbd = data;
    551586
    552         cbd->ic->acc->prpl->add_buddy(cbd->ic, cbd->handle, NULL);
     587        if (cbd->ic->acc->prpl->add_buddy) {
     588                cbd->ic->acc->prpl->add_buddy(cbd->ic, cbd->handle, NULL);
     589        }
    553590
    554591        imcb_ask_cb_free(data);
Note: See TracChangeset for help on using the changeset viewer.