Mercurial > pidgin.yaz
comparison src/list.c @ 4938:461e8c89514f
[gaim-migrate @ 5272]
don't let people delete buddies they don't even know are there ;-)
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Tue, 01 Apr 2003 04:02:37 +0000 |
parents | 4228bddbf2cd |
children | d7a549ab95c2 |
comparison
equal
deleted
inserted
replaced
4937:4228bddbf2cd | 4938:461e8c89514f |
---|---|
340 | 340 |
341 void gaim_blist_remove_group (struct group *group) | 341 void gaim_blist_remove_group (struct group *group) |
342 { | 342 { |
343 struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops; | 343 struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops; |
344 GaimBlistNode *node = (GaimBlistNode*)group; | 344 GaimBlistNode *node = (GaimBlistNode*)group; |
345 GaimBlistNode *child = node->child; | 345 |
346 while (child) { | 346 if(node->child) { |
347 GaimBlistNode *n = child; | 347 char *buf; |
348 child = child->next; | 348 int count = 0; |
349 gaim_blist_remove_buddy((struct buddy*)n); | 349 GaimBlistNode *child = node->child; |
350 } | 350 |
351 | 351 while(child) { |
352 if(node->parent->child == node) | 352 count++; |
353 child = child->next; | |
354 } | |
355 | |
356 buf = g_strdup_printf(_("%d buddies from group %s were not " | |
357 "removed because their accounts were not logged in. These " | |
358 "buddies, and the group were not removed.\n"), | |
359 count, group->name); | |
360 do_error_dialog(_("Group Not Removed"), buf, GAIM_ERROR); | |
361 g_free(buf); | |
362 return; | |
363 } | |
364 | |
365 if(node->parent && node->parent->child == node) | |
353 node->parent->child = node->next; | 366 node->parent->child = node->next; |
354 if (node->prev) | 367 if (node->prev) |
355 node->prev->next = node->next; | 368 node->prev->next = node->next; |
356 if (node->next) | 369 if (node->next) |
357 node->next->prev = node->prev; | 370 node->next->prev = node->prev; |