Mercurial > pidgin
changeset 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 | b1365291f002 |
children | 01e349782075 |
files | src/buddy.c src/dialogs.c src/gtkconv.c src/list.c src/list.h src/multi.c src/perl.c src/protocols/gg/gg.c src/protocols/irc/irc.c src/protocols/oscar/oscar.c src/protocols/toc/toc.c src/protocols/zephyr/zephyr.c |
diffstat | 12 files changed, 168 insertions(+), 293 deletions(-) [+] |
line wrap: on
line diff
--- a/src/buddy.c Sat Mar 15 01:07:08 2003 +0000 +++ b/src/buddy.c Sat Mar 15 03:23:30 2003 +0000 @@ -263,16 +263,6 @@ #endif } -static void gaim_gtk_blist_reordered_cb(GtkTreeModel *model, - GtkTreePath *path, - GtkTreeIter *iter, - gint *neworder, - gpointer null) -{ - debug_printf("This doesn't work because GTK is broken\n"); - -} - /* This is called 10 seconds after the buddy logs in. It removes the "logged in" icon and replaces it with * the normal status icon */
--- a/src/dialogs.c Sat Mar 15 01:07:08 2003 +0000 +++ b/src/dialogs.c Sat Mar 15 03:23:30 2003 +0000 @@ -935,20 +935,21 @@ GList *tmp = NULL; char *tmp2; struct group *g; - GSList *grp = gaim_blist_groups(); - GSList *grp1 = grp; - - if (!grp) { + + GaimBlistNode *gnode = gaim_get_blist()->root; + + if (!gnode) { tmp2 = g_strdup(_("Buddies")); tmp = g_list_append(tmp, tmp2); } else { - while (grp1) { - g = (struct group *)grp1->data; - tmp2 = g->name; - tmp = g_list_append(tmp, tmp2); - grp1 = g_slist_next(grp1); + while (gnode) { + if(GAIM_BLIST_NODE_IS_GROUP(gnode)) { + g = (struct group *)gnode; + tmp2 = g->name; + tmp = g_list_append(tmp, tmp2); + } + gnode = gnode->next; } - g_slist_free(grp); } return tmp; } @@ -3997,7 +3998,6 @@ { const char *new_name; struct buddy *b; - GSList *gr, *gr1; new_name = gtk_entry_get_text(GTK_ENTRY(entry)); b = g_object_get_data(obj, "buddy"); @@ -4007,27 +4007,12 @@ return; } - gr = gaim_blist_groups(); - gr1 = gr; - while (gr1) { - GSList *mem = gaim_blist_members((struct group*)gr->data); - if (g_slist_find(mem, b)) - break; - gr1 = gr1->next; - g_slist_free(mem); - } - g_slist_free(gr); - if (!gr) { - destroy_dialog(rename_bud_dialog, rename_bud_dialog); - return; - } - if (new_name && (strlen(new_name) != 0) && strcmp(new_name, b->name)) { struct group *g = gaim_find_buddys_group(b); - char *prevname = g_strdup(b->name); + char *prevname = b->name; if (g) serv_remove_buddy(b->account->gc, b->name, g->name); - g_snprintf(b->name, sizeof(b->name), "%s", new_name); + b->name = g_strdup(new_name); serv_add_buddy(b->account->gc, b->name); gaim_blist_rename_buddy(b, prevname); gaim_blist_save();
--- a/src/gtkconv.c Sat Mar 15 01:07:08 2003 +0000 +++ b/src/gtkconv.c Sat Mar 15 03:23:30 2003 +0000 @@ -2202,8 +2202,7 @@ static GList * generate_invite_user_names(struct gaim_connection *gc) { - GSList *grp = gaim_blist_groups(), *grp1; - GSList *bl, *bl1; + GaimBlistNode *gnode,*bnode; struct group *g; struct buddy *buddy; static GList *tmp = NULL; @@ -2214,18 +2213,19 @@ tmp = g_list_append(NULL, ""); if (gc != NULL) { - for (grp1 = grp; grp1 != NULL; grp1 = grp1->next) { - g = (struct group *)grp1->data; - bl = gaim_blist_members(g); - for (bl1 = bl; bl1 != NULL; bl1 = bl1->next) { - buddy = (struct buddy *)bl1->data; - - if (buddy->present) + 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 && buddy->present) tmp = g_list_append(tmp, buddy->name); } - g_slist_free(bl); } - g_slist_free(grp); } return tmp;
--- a/src/list.c Sat Mar 15 01:07:08 2003 +0000 +++ b/src/list.c Sat Mar 15 03:23:30 2003 +0000 @@ -65,51 +65,6 @@ return gaim_blist_get_last_sibling(node->child); } -static void gaim_blist_print() -{ - GaimBlistNode *group = gaimbuddylist->root; - GaimBlistNode *buddy; - if (!gaimbuddylist) - return; - while (group) { - debug_printf("+-%s %p\n", ((struct group*)group)->name, group); - buddy = group->child; - while (buddy) { - debug_printf("|--- %d %s\t\t%d\n", ((struct buddy*)buddy)->present, ((struct buddy*)buddy)->name, ((struct buddy*)buddy)->idle); - buddy = buddy->next; - } - group = group->next; - } -} - -/***************************************************************************** - * Public Utility Functions * - *****************************************************************************/ - -GSList *gaim_blist_members(struct group *g) -{ - GaimBlistNode *group = (GaimBlistNode*)g; - GSList *list = NULL; - GaimBlistNode *child = group->child; - while (child) { - list = g_slist_append(list, child); - child = child->next; - } - return list; -} - -GSList *gaim_blist_groups() -{ - struct gaim_buddy_list *gaimbuddylist = gaim_get_blist(); - GSList *list = NULL; - GaimBlistNode *g = gaimbuddylist->root; - while (g) { - list = g_slist_append(list, g); - g = g->next; - } - return list; -} - /***************************************************************************** * Public API functions * *****************************************************************************/ @@ -313,21 +268,21 @@ void gaim_blist_add_group (struct group *group, GaimBlistNode *node) { struct gaim_blist_ui_ops *ops; - gboolean save; - + gboolean save = FALSE; + if (!gaimbuddylist) gaimbuddylist = gaim_blist_new(); ops = gaimbuddylist->ui_ops; - + if (!gaimbuddylist->root) { gaimbuddylist->root = (GaimBlistNode*)group; return; } - - - if (!node) + + + if (!node) node = gaim_blist_get_last_sibling(gaimbuddylist->root); - + if (gaim_find_group(group->name)) { /* This is just being moved */ GaimBlistNode *node2 = ((GaimBlistNode*)group)->next; @@ -341,14 +296,14 @@ node3->next = node2; save = TRUE; } - + ((GaimBlistNode*)group)->next = node ? node->next : NULL; ((GaimBlistNode*)group)->prev = node; node->next = (GaimBlistNode*)group; if (ops) ops->update(gaimbuddylist, (GaimBlistNode*)group); - if (save) + if (save) gaim_blist_save(); } @@ -834,15 +789,14 @@ } gboolean gaim_group_on_account(struct group *g, struct gaim_account *account) { - GSList *buds = gaim_blist_members(g); - GSList *buds1 = buds; - while(buds1) { - struct buddy *b = buds->data; + GaimBlistNode *bnode; + for(bnode = g->node.child; bnode; bnode = bnode->next) { + struct buddy *b = (struct buddy *)bnode; + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; if((!account && b->account->gc) || b->account == account) return TRUE; - buds1 = buds1->next; } - g_slist_free(buds); return FALSE; } @@ -1167,20 +1121,24 @@ static void gaim_blist_write(FILE *file, struct gaim_account *exp_acct) { GSList *accounts, *buds; + GaimBlistNode *gnode,*bnode; struct group *group; struct buddy *bud; fprintf(file, "<?xml version='1.0' encoding='UTF-8' ?>\n"); fprintf(file, "<gaim version=\"1\">\n"); fprintf(file, "\t<blist>\n"); - for(group = (struct group*)gaimbuddylist->root; group; group = (struct group*)((GaimBlistNode*)group)->next) { + for(gnode = gaimbuddylist->root; gnode; gnode = gnode->next) { + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + group = (struct group *)gnode; if(!exp_acct || gaim_group_on_account(group, exp_acct)) { char *group_name = g_markup_escape_text(group->name, -1); - GSList *buds1; fprintf(file, "\t\t<group name=\"%s\">\n", group_name); - buds = gaim_blist_members(group); - for(buds1 = buds; buds1; buds1 = buds1->next) { - bud = buds1->data; + for(bnode = gnode->child; bnode; bnode = bnode->next) { + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; + bud = (struct buddy *)bnode; if(!exp_acct || bud->account == exp_acct) { char *bud_name = g_markup_escape_text(bud->name, -1); char *bud_alias = NULL; @@ -1206,7 +1164,6 @@ g_free(acct_name); } } - g_slist_free(buds); fprintf(file, "\t\t</group>\n"); g_free(group_name); }
--- a/src/list.h Sat Mar 15 01:07:08 2003 +0000 +++ b/src/list.h Sat Mar 15 03:23:30 2003 +0000 @@ -111,33 +111,10 @@ void (*remove)(struct gaim_buddy_list *list, GaimBlistNode *node); /**< This removes a node from the list */ void (*destroy)(struct gaim_buddy_list *list); /**< When the list gets destroyed, this gets called to destroy the UI. */ - void (*set_visible)(struct gaim_buddy_list *list, + void (*set_visible)(struct gaim_buddy_list *list, gboolean show); /**< Hides or unhides the buddy list */ - -}; - -/**************************************************************************/ -/** Public Utility Functions */ -/**************************************************************************/ -/*@{*/ -/** - * Returns a GSList of the groups - */ -GSList *gaim_blist_groups(); - -/** - * Returns a GSList of the members of a group node. - * - * It's obviously much faster to recurse the GaimBlistNode linked list - * then using this function. You should try to avoid using it. Only use it - * when you're about to make a milestone release in a few hours and are desperately - * trying to add a critical feature - * - * @param group The group - */ -GSList *gaim_blist_members(struct group *group); -/*@}*/ +}; /**************************************************************************/ /** @name Buddy List API */
--- a/src/multi.c Sat Mar 15 01:07:08 2003 +0000 +++ b/src/multi.c Sat Mar 15 03:23:30 2003 +0000 @@ -154,24 +154,22 @@ void destroy_gaim_conn(struct gaim_connection *gc) { - GSList *g = gaim_blist_groups(), *g1 = g; - GSList *h, *h1; + GaimBlistNode *gnode,*bnode; struct group *m; struct buddy *n; - while (g1) { - m = (struct group *)g1->data; - g1 = g_slist_next(g1); - h1 = h = gaim_blist_members(m); - while (h1) { - n = (struct buddy *)h1->data; - h1 = g_slist_next(h1); + for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + m = (struct group *)gnode; + for(bnode = gnode->child; bnode; bnode = bnode->next) { + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; + n = (struct buddy *)bnode; if(n->account == gc->account) { n->present = 0; } } - g_slist_free(h); } - g_slist_free(g); g_free(gc->away); g_free(gc->away_state); g_free(gc); @@ -1314,8 +1312,7 @@ static void do_del_acct(struct gaim_account *account) { GtkTreeIter iter; - GSList *grps1, *grps, *buds; - grps1 = grps = gaim_blist_groups(); + GaimBlistNode *gnode,*bnode; if (account->gc) { account->gc->wants_to_die = TRUE; @@ -1328,24 +1325,22 @@ /* remove the buddies for the account we just destroyed */ - while(grps1) { - struct group *g = grps1->data; - GSList *buds1, *buds = gaim_blist_members(g); - buds1 = buds; - grps1 = grps1->next; - while(buds1) { - struct buddy *b = buds1->data; - buds1 = buds1->next; + for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + struct group *g = (struct group *)gnode; + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + for(bnode = gnode->child; bnode; bnode = bnode->next) { + struct buddy *b = (struct buddy *)bnode; + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; if(b->account == account) { gaim_blist_remove_buddy(b); } } - g_slist_free(buds); - if(!((GaimBlistNode*)g)->child) { + if(!gnode->child) { gaim_blist_remove_group(g); } } - g_slist_free(grps); gaim_accounts = g_slist_remove(gaim_accounts, account); @@ -1522,7 +1517,7 @@ struct signon_meter *meter = find_signon_meter(gc); GList *wins; GtkTreeIter iter; - GSList *grps, *grps1, *buds, *buds1; + GaimBlistNode *gnode,*bnode; GList *add_buds=NULL; GList *l; @@ -1579,19 +1574,18 @@ } /* let the prpl know what buddies we pulled out of the local list */ - grps = gaim_blist_groups(); - for(grps1 = grps; grps1; grps1 = grps1->next) { - struct group *g = grps1->data; - buds = gaim_blist_members(g); - for(buds1 = buds; buds1; buds1 = buds1->next) { - struct buddy *b = buds1->data; + for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + for(bnode = gnode->child; bnode; bnode = bnode->next) { + struct buddy *b = (struct buddy *)bnode; + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; if(b->account == gc->account) { add_buds = g_list_append(add_buds, b->name); } } - g_slist_free(buds); } - g_slist_free(grps); if(add_buds) { serv_add_buddies(gc, add_buds);
--- 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); }
--- a/src/protocols/gg/gg.c Sat Mar 15 01:07:08 2003 +0000 +++ b/src/protocols/gg/gg.c Sat Mar 15 03:23:30 2003 +0000 @@ -1,6 +1,6 @@ /* * gaim - Gadu-Gadu Protocol Plugin - * $Id: gg.c 5095 2003-03-14 17:06:00Z thekingant $ + * $Id: gg.c 5105 2003-03-15 03:23:30Z faceprint $ * * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL> * @@ -1006,8 +1006,7 @@ gchar *u = gg_urlencode(gc->username); gchar *p = gg_urlencode(gc->password); - GSList *gr = gaim_blist_groups(); - GSList *gr1 = gr; + GaimBlistNode *gnode, *bnode; he->gc = gc; he->type = AGG_HTTP_USERLIST_EXPORT; @@ -1018,13 +1017,16 @@ g_free(u); g_free(p); - while (gr1) { - struct group *g = gr1->data; - GSList *m = gaim_blist_members(g); - GSList *m1 = m; + for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + struct group *g = (struct group *)gnode; int num_added=0; - while (m1) { - struct buddy *b = m1->data; + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + for(bnode = gnode->child; bnode; bnode = bnode->next) { + struct buddy *b = (struct buddy *)bnode; + + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; if(b->account == gc->account) { gchar *newdata; @@ -1053,12 +1055,8 @@ g_free(show); g_free(name); } - m1 = g_slist_next(m1); } - g_slist_free(m); - gr = g_slist_next(gr1); } - g_slist_free(gr); if (proxy_connect(gc->account, GG_PUBDIR_HOST, GG_PUBDIR_PORT, http_req_callback, he) < 0) { do_error_dialog(_("Couldn't export buddy list"),
--- a/src/protocols/irc/irc.c Sat Mar 15 01:07:08 2003 +0000 +++ b/src/protocols/irc/irc.c Sat Mar 15 03:23:30 2003 +0000 @@ -569,7 +569,7 @@ handle_list(struct gaim_connection *gc, char *list) { struct irc_data *id = gc->proto_data; - GSList *gr, *gr1; + GaimBlistNode *gnode, *bnode; id->str = g_string_append_c(id->str, ' '); id->str = g_string_append(id->str, list); @@ -578,13 +578,14 @@ return; g_strdown(id->str->str); - gr = gaim_blist_groups(); - gr1 = gr; - while (gr1) { - GSList *m = gaim_blist_members((struct group *)gr1->data); - GSList *m1 = m; - while (m1) { - struct buddy *b = m->data; + + for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + for(bnode = gnode->child; bnode; bnode = bnode->next) { + struct buddy *b = (struct buddy *)bnode; + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; if(b->account->gc == gc) { char *tmp = g_strdup(b->name); char *x, *l; @@ -599,12 +600,8 @@ serv_got_update(gc, b->name, 0, 0, 0, 0, 0); g_free(tmp); } - m1 = m1->next; } - g_slist_free(m); - gr1 = gr1->next; } - g_slist_free(gr); g_string_free(id->str, TRUE); id->str = g_string_new(""); } @@ -618,17 +615,18 @@ int n = g_snprintf(buf, sizeof(buf), "ISON"); gboolean found = FALSE; - GSList *gr = gaim_blist_groups(); - GSList *gr1 = gr; - if (!gr || id->bc) + GaimBlistNode *gnode, *bnode; + + if (id->bc) return TRUE; - while (gr1) { - struct group *g = gr->data; - GSList *m = gaim_blist_members(g); - GSList *m1 = m; - while (m1) { - struct buddy *b = m->data; + for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + for(bnode = gnode->child; bnode; bnode = bnode->next) { + struct buddy *b = (struct buddy *)bnode; + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; if(b->account->gc == gc) { if (n + strlen(b->name) + 2 > sizeof(buf)) { g_snprintf(buf + n, sizeof(buf) - n, "\r\n"); @@ -640,12 +638,8 @@ found = TRUE; } - m1 = m1->next; } - g_slist_free(m); - gr1 = gr1->next; } - g_slist_free(gr); if (found) { g_snprintf(buf + n, sizeof(buf) - n, "\r\n");
--- a/src/protocols/oscar/oscar.c Sat Mar 15 01:07:08 2003 +0000 +++ b/src/protocols/oscar/oscar.c Sat Mar 15 03:23:30 2003 +0000 @@ -4544,20 +4544,19 @@ } /* end adding buddies from local list to server list */ { /* Check for maximum number of buddies */ - GSList *groups = gaim_blist_groups(), *cur; - for (cur=groups, tmp=0; cur; cur=g_slist_next(cur)) { - struct group* gr = (struct group*)cur->data; - GSList *buds = gaim_blist_members(gr); - GSList *buds1 = buds; - while(buds1) { - struct buddy *b = buds1->data; + GaimBlistNode *gnode,*bnode; + tmp = 0; + for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + for(bnode = gnode->child; bnode; bnode = bnode->next) { + struct buddy *b = (struct buddy *)bnode; + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; if(b->account == gc->account) tmp++; - buds1 = buds1->next; } - g_slist_free(buds); } - g_slist_free(groups); if (tmp > od->rights.maxbuddies) { char *dialog_msg = g_strdup_printf(_("The maximum number of buddies allowed in your buddy list is %d, and you have %d." @@ -4567,7 +4566,7 @@ g_free(dialog_msg); } } - + /* Activate SSI */ /* Sending the enable causes other people to be able to see you, and you to see them */ /* Make sure your privacy setting/invisibility is set how you want it before this! */ @@ -5417,16 +5416,19 @@ { struct oscar_data *od = gc->proto_data; gchar *nombre, *text, *tmp; - GSList *curg = gaim_blist_groups(), *curg1; + GaimBlistNode *gnode,*bnode; int num=0; text = g_strdup(_("You are awaiting authorization from the following buddies:<BR>")); - for (curg1 = curg; curg1; curg1=g_slist_next(curg1)) { - struct group *group = curg1->data; - GSList *curb = gaim_blist_members(group), *curb1; - for (curb1=curb; curb1; curb1=g_slist_next(curb1)) { - struct buddy *buddy = curb1->data; + for (gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + struct group *group = (struct group *)gnode; + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + for (bnode = gnode->child; bnode; bnode = bnode->next) { + struct buddy *buddy = (struct buddy *)bnode; + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; if (buddy->account == gc->account && aim_ssi_waitingforauth(od->sess->ssi.local, group->name, buddy->name)) { if (gaim_get_buddy_alias_only(buddy)) nombre = g_strdup_printf(" %s (%s)", buddy->name, gaim_get_buddy_alias_only(buddy)); @@ -5439,9 +5441,7 @@ num++; } } - g_slist_free(curb); } - g_slist_free(curg); if (!num) { tmp = g_strdup_printf("%s<BR>%s", text, _("<i>you are not waiting for authorization</i>"));
--- a/src/protocols/toc/toc.c Sat Mar 15 01:07:08 2003 +0000 +++ b/src/protocols/toc/toc.c Sat Mar 15 03:23:30 2003 +0000 @@ -267,9 +267,7 @@ static void toc_build_config(struct gaim_account *account, char *s, int len, gboolean show) { - GSList *grp = gaim_blist_groups(); - GSList *grp1 = grp; - GSList *mem, *mem1; + GaimBlistNode *gnode,*bnode; struct group *g; struct buddy *b; GSList *plist = account->permit; @@ -281,26 +279,24 @@ account->permdeny = 1; pos += g_snprintf(&s[pos], len - pos, "m %d\n", account->permdeny); - while (len > pos && grp1) { - g = (struct group *)grp1->data; + for(gnode = gaim_get_blist()->root; gnode && len > pos; gnode = gnode->next) { + g = (struct group *)gnode; + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; if(gaim_group_on_account(g, account)) { pos += g_snprintf(&s[pos], len - pos, "g %s\n", g->name); - mem = gaim_blist_members(g); - mem1 = mem; - while (len > pos && mem1) { - b = (struct buddy *)mem1->data; + for(bnode = gnode->child; bnode && len > pos; bnode = bnode->next) { + b = (struct buddy *)bnode; + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; if(b->account == account) { pos += g_snprintf(&s[pos], len - pos, "b %s%s%s\n", b->name, (show && b->alias) ? ":" : "", (show && b->alias) ? b->alias : ""); } - mem1 = mem1->next; } - g_slist_free(mem); } - grp1 = g_slist_next(grp1); } - g_slist_free(grp); while (len > pos && plist) { pos += g_snprintf(&s[pos], len - pos, "p %s\n", (char *)plist->data);
--- a/src/protocols/zephyr/zephyr.c Sat Mar 15 01:07:08 2003 +0000 +++ b/src/protocols/zephyr/zephyr.c Sat Mar 15 03:23:30 2003 +0000 @@ -440,21 +440,20 @@ static gint check_loc(gpointer data) { - GSList *gr, *gr1, *m, *m1; + GaimBlistNode *gnode,*bnode; ZAsyncLocateData_t ald; ald.user = NULL; memset(&(ald.uid), 0, sizeof(ZUnique_Id_t)); ald.version = NULL; - gr = gaim_blist_groups(); - gr1 = gr; - while (gr1) { - struct group *g = gr1->data; - m = gaim_blist_members(g); - m1 = m; - while (m1) { - struct buddy *b = m1->data; + for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + for(bnode = gnode->child; bnode; bnode = bnode->next) { + struct buddy *b = (struct buddy *)bnode; + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; if(b->account->gc == zgc) { char *chk; chk = zephyr_normalize(b->name); @@ -463,12 +462,8 @@ free(ald.user); free(ald.version); } - m1 = m1->next; } - g_slist_free(m); - gr1 = gr1->next; } - g_slist_free(gr1); return TRUE; } @@ -669,8 +664,7 @@ static void write_anyone() { - GSList *gr, *gr1, *m, *m1; - struct group *g; + GaimBlistNode *gnode,*bnode; struct buddy *b; char *ptr, *fname, *ptr2; FILE *fd; @@ -682,14 +676,13 @@ return; } - gr = gaim_blist_groups(); - gr1 = gr; - while (gr1) { - g = gr1->data; - m = gaim_blist_members(g); - m1 = m; - while (m1) { - b = m1->data; + for(gnode = gaim_get_blist()->root; gnode; gnode = gnode->next) { + if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) + continue; + for(bnode = gnode->child; bnode; bnode = bnode->next) { + if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) + continue; + b = (struct buddy *)bnode; if(b->account->gc == zgc) { if ((ptr = strchr(b->name, '@')) != NULL) { ptr2 = ptr + 1; @@ -704,12 +697,8 @@ if (ptr) *ptr = '@'; } - m1 = m1->next; } - g_slist_free(m); - gr1 = gr1->next; } - g_slist_free(gr); fclose(fd); g_free(fname);