Mercurial > pidgin.yaz
diff src/perl.c @ 4785:1e28e7d802a1
[gaim-migrate @ 5105]
fix a few things, get rid of a few stale functions, and get rid of the
compatibility functions. wee!
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Sat, 15 Mar 2003 03:23:30 +0000 |
parents | c4c28874ecd3 |
children | 5496d1704ee0 |
line wrap: on
line diff
--- a/src/perl.c Sat Mar 15 01:07:08 2003 +0000 +++ b/src/perl.c Sat Mar 15 03:23:30 2003 +0000 @@ -666,27 +666,25 @@ struct gaim_connection *gc; struct buddy *buddy; struct group *g; - GSList *list = gaim_blist_groups(), *list1 = list; - GSList *mem, *mem1; + GaimBlistNode *gnode,*bnode; int i = 0; dXSARGS; items = 0; gc = (struct gaim_connection *)SvIV(ST(0)); - while (list1) { - g = (struct group *)list1->data; - mem1 = mem = gaim_blist_members(g); - while (mem1) { - buddy = (struct buddy *)mem1->data; + for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + g = (struct group *)gnode; + for(bnode = gnode->child; bnode; bnode = bnode->next) { + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; + buddy = (struct buddy *)bnode; if(buddy->account == gc->account) XST_mPV(i++, buddy->name); - mem1 = mem1->next; } - g_slist_free(mem); - list1 = g_slist_next(list1); } - g_slist_free(list); XSRETURN(i); } @@ -695,27 +693,24 @@ struct gaim_connection *gc; struct buddy *b; struct group *g; - GSList *list = gaim_blist_groups(), *list1 = list; - GSList *mem, *mem1; + GaimBlistNode *gnode,*bnode; int i = 0; dXSARGS; items = 0; gc = (struct gaim_connection *)SvIV(ST(0)); - while (list1) { - g = (struct group *)list1->data; - mem = gaim_blist_members(g); - mem1 = mem; - while (mem1) { - b = (struct buddy *)mem1->data; + for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + g = (struct group *)gnode; + for(bnode = gnode->child; bnode; bnode = bnode->next) { + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; + b = (struct buddy *)bnode; if (b->account == gc->account && b->present) XST_mPV(i++, b->name); - mem1 = mem1->next; } - g_slist_free(mem); - list1 = g_slist_next(list1); } - g_slist_free(list); XSRETURN(i); }