summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Schierer <lschiere@pidgin.im>2007-10-21 04:49:59 +0000
committerLuke Schierer <lschiere@pidgin.im>2007-10-21 04:49:59 +0000
commit0e8bf21cb057f2595fd4269f146fd26590edb5f5 (patch)
tree61693f816722a3df9a794c42adf10670a107a721
parent8e233a37aa4e4a7be38295474d10c3db045cef7c (diff)
downloadpidgin-0e8bf21cb057f2595fd4269f146fd26590edb5f5.tar.gz
applied changes from 3ae1e4b3dac8092886b4b8ab961d8d505433b4c4
through 4d5bbc54236419e777e3df044678b798605409bf
-rw-r--r--libpurple/buddyicon.c52
1 files changed, 24 insertions, 28 deletions
diff --git a/libpurple/buddyicon.c b/libpurple/buddyicon.c
index c76a770ca4..a2f761c004 100644
--- a/libpurple/buddyicon.c
+++ b/libpurple/buddyicon.c
@@ -505,37 +505,33 @@ purple_buddy_icons_set_for_user(PurpleAccount *account, const char *username,
purple_buddy_icon_set_data(icon, icon_data, icon_len, checksum);
else if (icon_data && icon_len > 0)
{
- if (icon_data != NULL && icon_len > 0)
- {
- PurpleBuddyIcon *icon = purple_buddy_icon_new(account, username, icon_data, icon_len, checksum);
-
- /* purple_buddy_icon_new() calls
- * purple_buddy_icon_set_data(), which calls
- * purple_buddy_icon_update(), which has the buddy list
- * and conversations take references as appropriate.
- * This function doesn't return icon, so we can't
- * leave a reference dangling. */
- purple_buddy_icon_unref(icon);
- }
- else
- {
- /* If the buddy list or a conversation was holding a
- * reference, we'd have found the icon in the cache.
- * Since we know we're deleting the icon, we only
- * need a subset of purple_buddy_icon_update(). */
-
- GSList *buddies = purple_find_buddies(account, username);
- while (buddies != NULL)
- {
- PurpleBuddy *buddy = (PurpleBuddy *)buddies->data;
+ PurpleBuddyIcon *icon = purple_buddy_icon_new(account, username, icon_data, icon_len, checksum);
+
+ /* purple_buddy_icon_new() calls
+ * purple_buddy_icon_set_data(), which calls
+ * purple_buddy_icon_update(), which has the buddy list
+ * and conversations take references as appropriate.
+ * This function doesn't return icon, so we can't
+ * leave a reference dangling. */
+ purple_buddy_icon_unref(icon);
+ }
+ else
+ {
+ /* If the buddy list or a conversation was holding a
+ * reference, we'd have found the icon in the cache.
+ * Since we know we're deleting the icon, we only
+ * need a subset of purple_buddy_icon_update(). */
- unref_filename(purple_blist_node_get_string((PurpleBlistNode *)buddy, "buddy_icon"));
- purple_blist_node_remove_setting((PurpleBlistNode *)buddy, "buddy_icon");
- purple_blist_node_remove_setting((PurpleBlistNode *)buddy, "icon_checksum");
+ GSList *buddies = purple_find_buddies(account, username);
+ while (buddies != NULL)
+ {
+ PurpleBuddy *buddy = (PurpleBuddy *)buddies->data;
- buddies = g_slist_delete_link(buddies, buddies);
- }
+ unref_filename(purple_blist_node_get_string((PurpleBlistNode *)buddy, "buddy_icon"));
+ purple_blist_node_remove_setting((PurpleBlistNode *)buddy, "buddy_icon");
+ purple_blist_node_remove_setting((PurpleBlistNode *)buddy, "icon_checksum");
+ buddies = g_slist_delete_link(buddies, buddies);
}
}
}