changeset 7311:1c8830db0189

[gaim-migrate @ 7895] Conversation windows kept a GaimBuddyIcon set even after the icon was destroyed. Now all conversations containing the icon being destroyed are updated to remove the icon. This fixes bug #826527, which javabsp closed a bit too prematurely ;) However, because GaimConversation references it, this should never actually happen, so I suspect something else is happening, but sanity statements are good anyway. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 21 Oct 2003 17:41:57 +0000
parents dd4b4a187171
children b8ce6e194cff
files src/buddyicon.c
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddyicon.c	Tue Oct 21 17:18:46 2003 +0000
+++ b/src/buddyicon.c	Tue Oct 21 17:41:57 2003 +0000
@@ -75,7 +75,10 @@
 void
 gaim_buddy_icon_destroy(GaimBuddyIcon *icon)
 {
+	GaimConversation *conv;
+	GaimAccount *account;
 	GHashTable *icon_cache;
+	const char *username;
 
 	g_return_if_fail(icon != NULL);
 
@@ -86,6 +89,14 @@
 		return;
 	}
 
+	account  = gaim_buddy_icon_get_account(icon);
+	username = gaim_buddy_icon_get_username(icon);
+
+	conv = gaim_find_conversation_with_account(username, account);
+
+	if (conv != NULL && gaim_conversation_get_type(conv) == GAIM_CONV_IM)
+		gaim_conv_im_set_icon(GAIM_CONV_IM(conv), NULL);
+
 	icon_cache = g_hash_table_lookup(account_cache,
 									 gaim_buddy_icon_get_account(icon));