From: Mark D. <the...@us...> - 2005-04-25 03:55:18
|
Update of /cvsroot/gaim/gaim/src/protocols/napster In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18990/src/protocols/napster Modified Files: napster.c Log Message: We no longer call "serv_add_buddies" at log in. Any PRPL that relied on that should look through the buddy list itself and do whatever it needs to after calling gaim_connection_set_state(gc, GAIM_CONNECTED); Index: napster.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/napster/napster.c,v retrieving revision 1.110 retrieving revision 1.111 diff -u -d -p -r1.110 -r1.111 --- napster.c 11 Apr 2005 15:26:49 -0000 1.110 +++ napster.c 25 Apr 2005 03:55:08 -0000 1.111 @@ -147,12 +147,31 @@ static void nap_add_buddy(GaimConnection } /* 208 - MSG_CLIENT_ADD_HOTLIST_SEQ */ -static void nap_add_buddies(GaimConnection *gc, GList *buddies, GList *groups) +static void nap_send_buddylist(GaimConnection *gc) { - while (buddies) { - GaimBuddy *buddy = buddies->data; - nap_write_packet(gc, 208, "%s", buddy->name); - buddies = buddies->next; + GaimBuddyList *blist; + GaimBlistNode *gnode, *cnode, *bnode; + GaimBuddy *buddy; + + if ((blist = gaim_get_blist()) != NULL) + { + for (gnode = blist->root; gnode != NULL; gnode = gnode->next) + { + if (!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + for (cnode = gnode->child; cnode != NULL; cnode = cnode->next) + { + if (!GAIM_BLIST_NODE_IS_CONTACT(cnode)) + continue; + for (bnode = cnode->child; bnode != NULL; bnode = bnode->next) + { + if (!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; + buddy = (GaimBuddy *)bnode; + nap_write_packet(gc, 208, "%s", buddy->name); + } + } + } } } @@ -278,6 +297,9 @@ static void nap_callback(gpointer data, /* Our signon is complete */ gaim_connection_set_state(gc, GAIM_CONNECTED); + /* Send the server our buddy list */ + nap_send_buddylist(gc); + break; case 201: /* MSG_SERVER_SEARCH_RESULT */ @@ -609,7 +631,7 @@ static GaimPluginProtocolInfo prpl_info NULL, /* set_idle */ NULL, /* change_passwd */ nap_add_buddy, /* add_buddy */ - nap_add_buddies, /* add_buddies */ + NULL, /* add_buddies */ nap_remove_buddy, /* remove_buddy */ NULL, /* remove_buddies */ NULL, /* add_permit */ |