Changeset f0cb961 for protocols/yahoo


Ignore:
Timestamp:
2007-04-19T06:03:43Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
d323394c
Parents:
33dc261
Message:

More API changes: buddy list management. imcb_add_buddy() is now a *real*
callback, it's only called from inside IM-modules. This makes sure a buddy
only gets added to the BitlBee structures if the add was successful. This
gets rid of the weirdness described in #55. Unfortunately for now this
change breaks A) automatic renaming of ICQ contacts (if there are names
stored in the contact list) B) add -tmp.

Location:
protocols/yahoo
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • protocols/yahoo/libyahoo2.c

    r33dc261 rf0cb961  
    24032403                where = "Unknown";
    24042404
    2405         bud = y_new0(struct yahoo_buddy, 1);
    2406         bud->id = strdup(who);
    2407         bud->group = strdup(where);
    2408         bud->real_name = NULL;
    2409 
    2410         yd->buddies = y_list_append(yd->buddies, bud);
     2405        /* status: 0 == Successful, 1 == Error (does not exist), 2 == Already in list */
     2406        if( status == 0 ) {
     2407                bud = y_new0(struct yahoo_buddy, 1);
     2408                bud->id = strdup(who);
     2409                bud->group = strdup(where);
     2410                bud->real_name = NULL;
     2411               
     2412                yd->buddies = y_list_append(yd->buddies, bud);
     2413               
     2414                /* Possibly called already, but at least the call above doesn't
     2415                   seem to happen every time (not anytime I tried). */
     2416                YAHOO_CALLBACK(ext_yahoo_contact_added)(yd->client_id, me, who, NULL);
     2417        }
    24112418
    24122419/*      YAHOO_CALLBACK(ext_yahoo_status_changed)(yd->client_id, who, status, NULL, (status==YAHOO_STATUS_AVAILABLE?0:1)); */
  • protocols/yahoo/yahoo.c

    r33dc261 rf0cb961  
    532532                }
    533533               
    534                 add_buddy( ic, b->group, b->id, b->real_name );
     534                imcb_add_buddy( ic, b->id, b->group );
     535                imcb_rename_buddy( ic, b->id, b->real_name );
     536               
    535537                bl = bl->next;
    536538        }
     
    904906void ext_yahoo_contact_added( int id, const char *myid, const char *who, const char *msg )
    905907{
     908        /* Groups schmoups. If I want to handle groups properly I can get the
     909           buddy data from some internal libyahoo2 structure. */
     910        imcb_add_buddy( byahoo_get_ic_by_id( id ), (char*) who, NULL );
    906911}
    907912
Note: See TracChangeset for help on using the changeset viewer.