diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2007-04-18 23:03:43 -0700 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2007-04-18 23:03:43 -0700 |
commit | f0cb961652cbd639e89dcd88a86f20a2414146c4 (patch) | |
tree | 7bddf3e5f8cd1402639b134773adcb4d04c375dc /protocols/yahoo/libyahoo2.c | |
parent | 33dc2618520409c0d52efff335fe299c26f6dd42 (diff) |
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.
Diffstat (limited to 'protocols/yahoo/libyahoo2.c')
-rw-r--r-- | protocols/yahoo/libyahoo2.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c index 38041ad4..5beae687 100644 --- a/protocols/yahoo/libyahoo2.c +++ b/protocols/yahoo/libyahoo2.c @@ -2402,12 +2402,19 @@ static void yahoo_process_buddyadd(struct yahoo_input_data *yid, struct yahoo_pa if(!where) where = "Unknown"; - bud = y_new0(struct yahoo_buddy, 1); - bud->id = strdup(who); - bud->group = strdup(where); - bud->real_name = NULL; - - yd->buddies = y_list_append(yd->buddies, bud); + /* status: 0 == Successful, 1 == Error (does not exist), 2 == Already in list */ + if( status == 0 ) { + bud = y_new0(struct yahoo_buddy, 1); + bud->id = strdup(who); + bud->group = strdup(where); + bud->real_name = NULL; + + yd->buddies = y_list_append(yd->buddies, bud); + + /* Possibly called already, but at least the call above doesn't + seem to happen every time (not anytime I tried). */ + YAHOO_CALLBACK(ext_yahoo_contact_added)(yd->client_id, me, who, NULL); + } /* YAHOO_CALLBACK(ext_yahoo_status_changed)(yd->client_id, who, status, NULL, (status==YAHOO_STATUS_AVAILABLE?0:1)); */ } |