changeset 4360:c435a29370b8

[gaim-migrate @ 4626] Cleaning up after myself, and fixing a small bug. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 20 Jan 2003 09:30:30 +0000
parents 5fb47ec9bfe4
children 25d5b2a7545f
files src/conversation.c src/gtkconv.c
diffstat 2 files changed, 12 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/conversation.c	Mon Jan 20 09:10:23 2003 +0000
+++ b/src/conversation.c	Mon Jan 20 09:30:30 2003 +0000
@@ -631,15 +631,15 @@
 	node = g_list_nth(gaim_window_get_conversations(win), index);
 	conv = (struct gaim_conversation *)node->data;
 
+	if (ops != NULL && ops->remove_conversation != NULL)
+		ops->remove_conversation(win, conv);
+
 	win->conversations = g_list_remove_link(win->conversations, node);
 
 	g_list_free_1(node);
 
 	win->conversation_count--;
 
-	if (ops != NULL && ops->remove_conversation != NULL)
-		ops->remove_conversation(win, conv);
-
 	conv->window = NULL;
 
 	if (gaim_window_get_conversation_count(win) == 0)
--- a/src/gtkconv.c	Mon Jan 20 09:10:23 2003 +0000
+++ b/src/gtkconv.c	Mon Jan 20 09:30:30 2003 +0000
@@ -1990,7 +1990,8 @@
 }
 
 static void
-generate_send_as_items(struct gaim_window *win)
+generate_send_as_items(struct gaim_window *win,
+					   struct gaim_conversation *deleted_conv)
 {
 	struct gaim_gtk_window *gtkwin;
 	GtkWidget *menu;
@@ -2077,6 +2078,10 @@
 		struct aim_user *user;
 
 		conv = (struct gaim_conversation *)convs->data;
+
+		if (conv == deleted_conv)
+			continue;
+
 		user = gaim_conversation_get_user(conv);
 
 		if (user->gc == NULL) {
@@ -2088,8 +2093,6 @@
 				first_offline = FALSE;
 			}
 
-			printf("Adding '%s'\n", user->username);
-
 			menuitem = gtk_radio_menu_item_new_with_label(group,
 														  user->username);
 			group = gtk_radio_menu_item_group(GTK_RADIO_MENU_ITEM(menuitem));
@@ -2442,7 +2445,7 @@
 	gtkwin->menu.sounds = gtk_item_factory_get_widget(item_factory,
 			"/Options/Enable Sounds");
 
-	generate_send_as_items(win);
+	generate_send_as_items(win, NULL);
 
 	gtk_container_add(GTK_CONTAINER(hb), gtkwin->menu.menubar);
 
@@ -3410,14 +3413,10 @@
 	gaim_gtk_set_state_lock(FALSE);
 
 	/* If this window is setup with an inactive gc, regenerate the menu. */
-	debug_printf("remove_conv: user == %p\n", gaim_conversation_get_user(conv));
-	debug_printf("remove_conv: user->gc == %p\n", gaim_conversation_get_user(conv)->gc);
-	debug_printf("remove_conv: gc == %p\n", gaim_conversation_get_gc(conv));
 	if (gaim_conversation_get_type(conv) == GAIM_CONV_IM &&
 		gaim_conversation_get_gc(conv) == NULL) {
 
-		debug_printf("Going to generate send as items.\n");
-		generate_send_as_items(win);
+		generate_send_as_items(win, conv);
 	}
 }
 
@@ -4124,7 +4123,7 @@
 	else if (type == GAIM_CONV_ACCOUNT_ONLINE ||
 			 type == GAIM_CONV_ACCOUNT_OFFLINE) {
 
-		generate_send_as_items(win);
+		generate_send_as_items(win, NULL);
 	}
 }