# HG changeset patch # User Nathan Walp # Date 1049169757 0 # Node ID 461e8c89514f31b44041802cda2226f46372e35d # Parent 4228bddbf2cdab513cf10d1b7452dd544d0ed22e [gaim-migrate @ 5272] don't let people delete buddies they don't even know are there ;-) committer: Tailor Script diff -r 4228bddbf2cd -r 461e8c89514f src/dialogs.c --- a/src/dialogs.c Tue Apr 01 03:27:50 2003 +0000 +++ b/src/dialogs.c Tue Apr 01 04:02:37 2003 +0000 @@ -448,12 +448,13 @@ while (b) { struct buddy *bd = (struct buddy *)b; struct gaim_conversation *c = gaim_find_conversation(bd->name); - serv_remove_buddy(bd->account->gc, bd->name, g->name); - gaim_blist_remove_buddy(bd); - - if (c != NULL) - gaim_conversation_update(c, GAIM_CONV_UPDATE_REMOVE); - + if(bd->account->gc) { + serv_remove_buddy(bd->account->gc, bd->name, g->name); + gaim_blist_remove_buddy(bd); + + if (c != NULL) + gaim_conversation_update(c, GAIM_CONV_UPDATE_REMOVE); + } b = b->next; } gaim_blist_remove_group(g); diff -r 4228bddbf2cd -r 461e8c89514f src/list.c --- a/src/list.c Tue Apr 01 03:27:50 2003 +0000 +++ b/src/list.c Tue Apr 01 04:02:37 2003 +0000 @@ -342,14 +342,27 @@ { struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops; GaimBlistNode *node = (GaimBlistNode*)group; - GaimBlistNode *child = node->child; - while (child) { - GaimBlistNode *n = child; - child = child->next; - gaim_blist_remove_buddy((struct buddy*)n); + + if(node->child) { + char *buf; + int count = 0; + GaimBlistNode *child = node->child; + + while(child) { + count++; + child = child->next; + } + + buf = g_strdup_printf(_("%d buddies from group %s were not " + "removed because their accounts were not logged in. These " + "buddies, and the group were not removed.\n"), + count, group->name); + do_error_dialog(_("Group Not Removed"), buf, GAIM_ERROR); + g_free(buf); + return; } - if(node->parent->child == node) + if(node->parent && node->parent->child == node) node->parent->child = node->next; if (node->prev) node->prev->next = node->next;