# HG changeset patch # User Christian Hammond # Date 1087535341 0 # Node ID 0c201a2386c72aa117c4b9deb411045b2cb626ed # Parent 96c481da57ea76b313c499930eed2d82bf09e6b5 [gaim-migrate @ 10113] gaim_buddy_icons_set_for_user() can now clear and remove the icon from everything and update the UI when the icon data is NULL and/or the icon length is 0. This *should* work. Tim will test it for me :) committer: Tailor Script diff -r 96c481da57ea -r 0c201a2386c7 src/buddyicon.c --- a/src/buddyicon.c Fri Jun 18 04:33:28 2004 +0000 +++ b/src/buddyicon.c Fri Jun 18 05:09:01 2004 +0000 @@ -81,6 +81,7 @@ GaimAccount *account; GHashTable *icon_cache; const char *username; + GSList *sl, *list; g_return_if_fail(icon != NULL); @@ -96,6 +97,16 @@ conv = gaim_find_conversation_with_account(username, account); + for (list = sl = gaim_find_buddies(account, username); sl != NULL; + sl = sl->next) + { + GaimBuddy *buddy = (GaimBuddy *)sl->data; + + gaim_buddy_set_icon(buddy, NULL); + } + + g_slist_free(list); + if (conv != NULL && gaim_conversation_get_type(conv) == GAIM_CONV_IM) gaim_conv_im_set_icon(GAIM_CONV_IM(conv), NULL); @@ -157,8 +168,8 @@ account = gaim_buddy_icon_get_account(icon); username = gaim_buddy_icon_get_username(icon); - for (list =sl = gaim_find_buddies(account, username); sl != NULL; - sl = sl->next) + for (list = sl = gaim_find_buddies(account, username); sl != NULL; + sl = sl->next) { GaimBuddy *buddy = (GaimBuddy *)sl->data; @@ -302,7 +313,19 @@ g_return_if_fail(account != NULL); g_return_if_fail(username != NULL); - gaim_buddy_icon_new(account, username, icon_data, icon_len); + if (icon_data == NULL || icon_len == 0) + { + GaimBuddyIcon *buddy_icon; + + buddy_icon = gaim_buddy_icons_find(account, username); + + if (buddy_icon != NULL) + gaim_buddy_icon_destroy(buddy_icon); + } + else + { + gaim_buddy_icon_new(account, username, icon_data, icon_len); + } } GaimBuddyIcon *