# HG changeset patch # User Stu Tomlinson # Date 1126373421 0 # Node ID 63e339161d83680e3e876af3753283b7977d084c # Parent 9c7ca8a8c4b807ae1dbba85013937850317fb351 [gaim-migrate @ 13731] Fix GaryBug#40 - IRC buddies never showed up except when first added committer: Tailor Script diff -r 9c7ca8a8c4b8 -r 63e339161d83 src/protocols/irc/msgs.c --- a/src/protocols/irc/msgs.c Sat Sep 10 17:28:04 2005 +0000 +++ b/src/protocols/irc/msgs.c Sat Sep 10 17:30:21 2005 +0000 @@ -440,6 +440,7 @@ void irc_msg_endmotd(struct irc_conn *irc, const char *name, const char *from, char **args) { GaimConnection *gc; + GaimBlistNode *gnode, *cnode, *bnode; gc = gaim_account_get_connection(irc->account); if (!gc) @@ -447,6 +448,27 @@ gaim_connection_set_state(gc, GAIM_CONNECTED); + /* this used to be in the core, but it's not now */ + for (gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + for(cnode = gnode->child; cnode; cnode = cnode->next) { + if(!GAIM_BLIST_NODE_IS_CONTACT(cnode)) + continue; + for(bnode = cnode->child; bnode; bnode = bnode->next) { + GaimBuddy *b; + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; + b = (GaimBuddy *)bnode; + if(b->account == gc->account) { + struct irc_buddy *ib = g_new0(struct irc_buddy, 1); + ib->name = g_strdup(b->name); + g_hash_table_insert(irc->buddies, ib->name, ib); + } + } + } + } + irc_blist_timeout(irc); if (!irc->timer) irc->timer = gaim_timeout_add(45000, (GSourceFunc)irc_blist_timeout, (gpointer)irc);