diff src/buddy.c @ 3059:966c4e460ebb

[gaim-migrate @ 3073] Better support for Jabber resources by Jim Seymour committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Fri, 15 Mar 2002 20:09:14 +0000
parents 5a459387755a
children 4f2f12bf4408
line wrap: on
line diff
--- a/src/buddy.c	Fri Mar 15 04:47:58 2002 +0000
+++ b/src/buddy.c	Fri Mar 15 20:09:14 2002 +0000
@@ -833,6 +833,20 @@
 }
 
 
+/*
+ * Find and remove CTree node associated with buddylist entry
+ */
+static void ui_remove_buddy_node(struct group *rem_g, struct buddy *rem_b)
+{
+	GtkCTreeNode *gnode = NULL, *bnode;
+
+	if((gnode = gtk_ctree_find_by_row_data(GTK_CTREE(edittree), NULL, rem_g)) != NULL &&
+		(bnode = gtk_ctree_find_by_row_data(GTK_CTREE(edittree), gnode, rem_b)) != NULL)
+	{
+		gtk_ctree_remove_node(GTK_CTREE(edittree), bnode);
+	}
+}
+
 void ui_remove_buddy(struct gaim_connection *gc, struct group *rem_g, struct buddy *rem_b)
 {
 	struct conversation *c;
@@ -870,6 +884,10 @@
 	c = find_conversation(rem_b->name);
 	if (c)
 		update_buttons_by_protocol(c);
+
+	/* Remove CTree node for buddy */
+	ui_remove_buddy_node(rem_g, rem_b);
+
 }
 
 void ui_remove_group(struct gaim_connection *gc, struct group *rem_g)
@@ -1284,7 +1302,6 @@
 			gct = b->gc;
 			serv_remove_buddy(b->gc, b->name, g->name);
 			remove_buddy(b->gc, g, b);
-			gtk_ctree_remove_node(GTK_CTREE(edittree), node);
 			do_export(gct);
 		} else if (*type == EDIT_GROUP) {
 			struct gaim_connection *gc = ((struct group *)type)->gc;