aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/yahoo
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/yahoo')
-rw-r--r--protocols/yahoo/libyahoo2.c19
-rw-r--r--protocols/yahoo/yahoo.c7
2 files changed, 19 insertions, 7 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)); */
}
diff --git a/protocols/yahoo/yahoo.c b/protocols/yahoo/yahoo.c
index 191a197c..c3d57a94 100644
--- a/protocols/yahoo/yahoo.c
+++ b/protocols/yahoo/yahoo.c
@@ -531,7 +531,9 @@ void ext_yahoo_got_buddies( int id, YList *buds )
yd->buddygroups = g_slist_append( yd->buddygroups, bg );
}
- add_buddy( ic, b->group, b->id, b->real_name );
+ imcb_add_buddy( ic, b->id, b->group );
+ imcb_rename_buddy( ic, b->id, b->real_name );
+
bl = bl->next;
}
}
@@ -903,6 +905,9 @@ void ext_yahoo_chat_yahooerror( int id, const char *me )
void ext_yahoo_contact_added( int id, const char *myid, const char *who, const char *msg )
{
+ /* Groups schmoups. If I want to handle groups properly I can get the
+ buddy data from some internal libyahoo2 structure. */
+ imcb_add_buddy( byahoo_get_ic_by_id( id ), (char*) who, NULL );
}
void ext_yahoo_rejected( int id, const char *who, const char *msg )