changeset 16556:26fb9b308cc1

This is Sadrul's icon-migrate.patch from ticket #314.
author Richard Laager <rlaager@wiktel.com>
date Sat, 28 Apr 2007 03:20:29 +0000
parents fb633ba3fb1e
children 9e8883a33365
files pidgin/gtkblist.c
diffstat 1 files changed, 11 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Sat Apr 28 03:19:52 2007 +0000
+++ b/pidgin/gtkblist.c	Sat Apr 28 03:20:29 2007 +0000
@@ -2163,7 +2163,6 @@
 	const guchar *data = NULL;
 	gsize len;
 	PurpleBuddy *buddy = NULL;
-	PurpleChat *chat = NULL;
 	PurpleAccount *account = NULL;
 	PurplePluginProtocolInfo *prpl_info = NULL;
 	PurpleStoredImage *custom_img;
@@ -2172,16 +2171,14 @@
 		buddy = purple_contact_get_priority_buddy((PurpleContact*)node);
 	} else if(PURPLE_BLIST_NODE_IS_BUDDY(node)) {
 		buddy = (PurpleBuddy*)node;
-	} else if(PURPLE_BLIST_NODE_IS_CHAT(node)) {
-		chat = (PurpleChat*)node;
 	} else {
 		return NULL;
 	}
 
-	if(buddy != NULL)
-		account = purple_buddy_get_account(buddy);
-	else if(chat != NULL)
-		account = chat->account;
+	if(buddy == NULL)
+		return NULL;
+
+	account = purple_buddy_get_account(buddy);
 
 	if(account && account->gc)
 		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(account->gc->prpl);
@@ -2199,18 +2196,14 @@
 	}
 
 	if (data == NULL) {
-		if(buddy != NULL) {
-			if (!(icon = purple_buddy_get_icon(buddy)))
-				if (!(icon = purple_buddy_icons_find(buddy->account, buddy->name))) /* Not sure I like this...*/
-					return NULL;
-			data = purple_buddy_icon_get_data(icon, &len);
-			if (data == NULL)
+		if (!(icon = purple_buddy_get_icon(buddy)))
+			if (!(icon = purple_buddy_icons_find(buddy->account, buddy->name))) /* Not sure I like this...*/
 				return NULL;
-		}
-	}
-
-	if(data == NULL)
-		return NULL;
+		data = purple_buddy_icon_get_data(icon, &len);
+
+		if(data == NULL)
+			return NULL;
+	}
 
 	loader = gdk_pixbuf_loader_new();
 	gdk_pixbuf_loader_write(loader, data, len, NULL);