diff 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
line wrap: on
line diff
--- 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;