changeset 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 c7ded94da25f
children 4f2f12bf4408
files ChangeLog src/buddy.c src/dialogs.c src/protocols/jabber/jabber.c src/protocols/oscar/oscar.c
diffstat 5 files changed, 28 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Mar 15 04:47:58 2002 +0000
+++ b/ChangeLog	Fri Mar 15 20:09:14 2002 +0000
@@ -1,7 +1,9 @@
 Gaim: The Pimpin' Penguin IM Clone thats good for the soul! 
 
 version 0.55:
-
+	* Better Jabber list management when using multiple
+	  resources (Thanks Jim Seymour)
+	
 version 0.54 (03/14/2002):
 	* Compiles without GdkPixbuf again
 	* GtkIMHtml will refresh when you set a new GTK+ theme
--- 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;
--- a/src/dialogs.c	Fri Mar 15 04:47:58 2002 +0000
+++ b/src/dialogs.c	Fri Mar 15 20:09:14 2002 +0000
@@ -469,7 +469,6 @@
 	serv_remove_buddy(b->gc, b->name, g->name);
 	remove_buddy(gc, g, b);
 	do_export(gc);
-	build_edit_tree();
 
 	cv = find_conversation(b->name);
 
--- a/src/protocols/jabber/jabber.c	Fri Mar 15 04:47:58 2002 +0000
+++ b/src/protocols/jabber/jabber.c	Fri Mar 15 20:09:14 2002 +0000
@@ -1089,6 +1089,9 @@
 	}
 
 
+	/*
+	 * Add or remove a buddy?
+	 */
 	if (BUD_SUB_TO_PEND(sub, ask) || BUD_SUBD_TO(sub, ask)) {
 		if ((b = find_buddy(GJ_GC(gjc), buddyname)) == NULL) {
 			debug_printf("adding buddy [4]: %s\n", buddyname);
@@ -1096,12 +1099,6 @@
 				name ? name : buddyname);
 			do_export(GJ_GC(gjc));
 		}
-	/*
-	 * TBD: this is what we *would* do if we could.  But the
-	 * remove_buddy() code doesn't update the UI.  And if the
-	 * user selects and tries to remove a buddy already removed
-	 * via here: *ka-boom*!
-	 *
 	}  else if (BUD_USUB_TO_PEND(sub, ask) || BUD_USUBD_TO(sub, ask) || !strcasecmp(sub, "remove")) {
 		if ((b = find_buddy(GJ_GC(gjc), buddyname)) != NULL) {
 			struct group *group;
@@ -1112,7 +1109,6 @@
 			remove_buddy(GJ_GC(gjc), group, b);
 			do_export(GJ_GC(gjc));
 		}
-	 */
 	}
 	g_free(buddyname);
 
--- a/src/protocols/oscar/oscar.c	Fri Mar 15 04:47:58 2002 +0000
+++ b/src/protocols/oscar/oscar.c	Fri Mar 15 20:09:14 2002 +0000
@@ -3172,7 +3172,10 @@
 	
 	if (!(dim = find_direct_im(od, sn)))
 		return 1;
-	gaim_input_remove(dim->watcher);   /* Otherwise, the callback will callback */
+	if (dim->watcher) {
+		gaim_input_remove(dim->watcher);   /* Otherwise, the callback will callback */
+		dim->watcher = 0;
+	}
 	while (gtk_events_pending())
 		gtk_main_iteration();