comparison src/buddyicon.c @ 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 208cb260d7a7
children 20d0c025312a
comparison
equal deleted inserted replaced
7310:dd4b4a187171 7311:1c8830db0189
73 } 73 }
74 74
75 void 75 void
76 gaim_buddy_icon_destroy(GaimBuddyIcon *icon) 76 gaim_buddy_icon_destroy(GaimBuddyIcon *icon)
77 { 77 {
78 GaimConversation *conv;
79 GaimAccount *account;
78 GHashTable *icon_cache; 80 GHashTable *icon_cache;
81 const char *username;
79 82
80 g_return_if_fail(icon != NULL); 83 g_return_if_fail(icon != NULL);
81 84
82 if (icon->ref_count > 0) 85 if (icon->ref_count > 0)
83 { 86 {
84 gaim_buddy_icon_unref(icon); 87 gaim_buddy_icon_unref(icon);
85 88
86 return; 89 return;
87 } 90 }
91
92 account = gaim_buddy_icon_get_account(icon);
93 username = gaim_buddy_icon_get_username(icon);
94
95 conv = gaim_find_conversation_with_account(username, account);
96
97 if (conv != NULL && gaim_conversation_get_type(conv) == GAIM_CONV_IM)
98 gaim_conv_im_set_icon(GAIM_CONV_IM(conv), NULL);
88 99
89 icon_cache = g_hash_table_lookup(account_cache, 100 icon_cache = g_hash_table_lookup(account_cache,
90 gaim_buddy_icon_get_account(icon)); 101 gaim_buddy_icon_get_account(icon));
91 102
92 if (icon_cache != NULL) 103 if (icon_cache != NULL)