changeset 12018:014c22dd9d06

[gaim-migrate @ 14311] Yet another docklet related patch from charkins. This one fixes the docklet flashing to stop if you close the conv. w/o reading the message. This changes the behavior of the "deleting-conversation" signal slightly - the conv. is removed from the conversations and ims or chats lists before emission instead of after. This is a wee bit strange, but doesn't seem like it'll have any ill effects. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 09 Nov 2005 02:54:22 +0000
parents 2b6e0be024fb
children 4c05f4dd3ab9
files plugins/docklet/docklet.c src/conversation.c
diffstat 2 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/docklet/docklet.c	Wed Nov 09 02:37:48 2005 +0000
+++ b/plugins/docklet/docklet.c	Wed Nov 09 02:54:22 2005 +0000
@@ -445,6 +445,8 @@
 						plugin, GAIM_CALLBACK(docklet_update_status_cb), NULL);
 	gaim_signal_connect(conv_handle, "conversation-created",
 						plugin, GAIM_CALLBACK(docklet_update_status_cb), NULL);
+	gaim_signal_connect(conv_handle, "deleting-conversation",
+						plugin, GAIM_CALLBACK(docklet_update_status_cb), NULL);
 	gaim_signal_connect(conv_handle, "conversation-updated",
 						plugin, GAIM_CALLBACK(docklet_conv_updated_cb), NULL);
 
--- a/src/conversation.c	Wed Nov 09 02:37:48 2005 +0000
+++ b/src/conversation.c	Wed Nov 09 02:54:22 2005 +0000
@@ -452,6 +452,14 @@
 		}
 	}
 
+	/* remove from conversations and im/chats lists prior to emit */
+	conversations = g_list_remove(conversations, conv);
+
+	if(conv->type==GAIM_CONV_TYPE_IM)
+		ims = g_list_remove(ims, conv);
+	else if(conv->type==GAIM_CONV_TYPE_CHAT)
+		chats = g_list_remove(chats, conv);
+
 	gaim_signal_emit(gaim_conversations_get_handle(),
 					 "deleting-conversation", conv);
 
@@ -472,8 +480,6 @@
 
 	g_list_free(g_list_first(conv->send_history));
 
-	conversations = g_list_remove(conversations, conv);
-
 	if (conv->type == GAIM_CONV_TYPE_IM) {
 		gaim_conv_im_stop_typing_timeout(conv->u.im);
 		gaim_conv_im_stop_type_again_timeout(conv->u.im);
@@ -485,8 +491,6 @@
 		GAIM_DBUS_UNREGISTER_POINTER(conv->u.im);
 		g_free(conv->u.im);
 		conv->u.im = NULL;
-
-		ims = g_list_remove(ims, conv);
 	}
 	else if (conv->type == GAIM_CONV_TYPE_CHAT) {
 
@@ -522,8 +526,6 @@
 		GAIM_DBUS_UNREGISTER_POINTER(conv->u.chat);
 		g_free(conv->u.chat);
 		conv->u.chat = NULL;
-
-		chats = g_list_remove(chats, conv);
 	}
 
 	g_hash_table_destroy(conv->data);