Mercurial > pidgin.yaz
comparison src/protocols/toc/toc.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 | 677d3cb193a1 |
comparison
equal
deleted
inserted
replaced
4784:b1365291f002 | 4785:1e28e7d802a1 |
---|---|
265 g_free(gc->proto_data); | 265 g_free(gc->proto_data); |
266 } | 266 } |
267 | 267 |
268 static void toc_build_config(struct gaim_account *account, char *s, int len, gboolean show) | 268 static void toc_build_config(struct gaim_account *account, char *s, int len, gboolean show) |
269 { | 269 { |
270 GSList *grp = gaim_blist_groups(); | 270 GaimBlistNode *gnode,*bnode; |
271 GSList *grp1 = grp; | |
272 GSList *mem, *mem1; | |
273 struct group *g; | 271 struct group *g; |
274 struct buddy *b; | 272 struct buddy *b; |
275 GSList *plist = account->permit; | 273 GSList *plist = account->permit; |
276 GSList *dlist = account->deny; | 274 GSList *dlist = account->deny; |
277 | 275 |
279 | 277 |
280 if (!account->permdeny) | 278 if (!account->permdeny) |
281 account->permdeny = 1; | 279 account->permdeny = 1; |
282 | 280 |
283 pos += g_snprintf(&s[pos], len - pos, "m %d\n", account->permdeny); | 281 pos += g_snprintf(&s[pos], len - pos, "m %d\n", account->permdeny); |
284 while (len > pos && grp1) { | 282 for(gnode = gaim_get_blist()->root; gnode && len > pos; gnode = gnode->next) { |
285 g = (struct group *)grp1->data; | 283 g = (struct group *)gnode; |
284 if(!GAIM_BLIST_NODE_IS_GROUP(gnode)) | |
285 continue; | |
286 if(gaim_group_on_account(g, account)) { | 286 if(gaim_group_on_account(g, account)) { |
287 pos += g_snprintf(&s[pos], len - pos, "g %s\n", g->name); | 287 pos += g_snprintf(&s[pos], len - pos, "g %s\n", g->name); |
288 mem = gaim_blist_members(g); | 288 for(bnode = gnode->child; bnode && len > pos; bnode = bnode->next) { |
289 mem1 = mem; | 289 b = (struct buddy *)bnode; |
290 while (len > pos && mem1) { | 290 if(!GAIM_BLIST_NODE_IS_BUDDY(bnode)) |
291 b = (struct buddy *)mem1->data; | 291 continue; |
292 if(b->account == account) { | 292 if(b->account == account) { |
293 pos += g_snprintf(&s[pos], len - pos, "b %s%s%s\n", b->name, | 293 pos += g_snprintf(&s[pos], len - pos, "b %s%s%s\n", b->name, |
294 (show && b->alias) ? ":" : "", | 294 (show && b->alias) ? ":" : "", |
295 (show && b->alias) ? b->alias : ""); | 295 (show && b->alias) ? b->alias : ""); |
296 } | 296 } |
297 mem1 = mem1->next; | |
298 } | 297 } |
299 g_slist_free(mem); | |
300 } | 298 } |
301 grp1 = g_slist_next(grp1); | 299 } |
302 } | |
303 g_slist_free(grp); | |
304 | 300 |
305 while (len > pos && plist) { | 301 while (len > pos && plist) { |
306 pos += g_snprintf(&s[pos], len - pos, "p %s\n", (char *)plist->data); | 302 pos += g_snprintf(&s[pos], len - pos, "p %s\n", (char *)plist->data); |
307 plist = plist->next; | 303 plist = plist->next; |
308 } | 304 } |