changeset 17403:ec8a4b674d50

Don't display the buddy icon for accounts that don't support buddy icons. Fixes #1414. This also includes a fix for crashing caused by the gtalk hackery (the crashing is fixed, but the hackery still doesn't work).
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 30 May 2007 22:47:51 +0000
parents 97b5bf0637ca
children 4b711c5c2db8
files pidgin/gtkaccount.c
diffstat 1 files changed, 18 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkaccount.c	Wed May 30 22:25:46 2007 +0000
+++ b/pidgin/gtkaccount.c	Wed May 30 22:47:51 2007 +0000
@@ -498,8 +498,8 @@
 		menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(dialog->protocol_menu));
 		item = gtk_menu_get_active(GTK_MENU(menu));
 		protocol = g_object_get_data(G_OBJECT(item), "protocol");
-		if (value == NULL && !strcmp(protocol, "prpl-fake") && 
-			!strcmp(purple_account_user_split_get_text(split), _("Domain")))
+		if (value == NULL && protocol != NULL && !strcmp(protocol, "prpl-fake") &&
+				!strcmp(purple_account_user_split_get_text(split), _("Domain")))
 			value = "gmail.com";
 
 		if (value != NULL)
@@ -827,9 +827,9 @@
 				menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(dialog->protocol_menu));
 				item = gtk_menu_get_active(GTK_MENU(menu));
 				protocol = g_object_get_data(G_OBJECT(item), "protocol");
-				if (str_value == NULL && !strcmp(protocol, "prpl-fake") &&
+				if (str_value == NULL && protocol != NULL && !strcmp(protocol, "prpl-fake") &&
 					!strcmp(_("Connect server"),  purple_account_option_get_text(option)))
-					str_value = "talk.google.com";	
+					str_value = "talk.google.com";
 		
 				if (str_value != NULL)
 					gtk_entry_set_text(GTK_ENTRY(entry), str_value);
@@ -2025,19 +2025,26 @@
 {
 	GdkPixbuf *pixbuf, *buddyicon = NULL;
 	PurpleStoredImage *img = NULL;
+	PurplePlugin *prpl;
+	PurplePluginProtocolInfo *prpl_info = NULL;
 
 	pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM);
 	if ((pixbuf != NULL) && purple_account_is_disconnected(account))
 		gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE);
 
-	if (purple_account_get_bool(account, "use-global-buddyicon", TRUE)) {
-		if (global_buddyicon != NULL)
-			buddyicon = g_object_ref(G_OBJECT(global_buddyicon));
-		/* This is for when set_account() is called for a single account */
-		else
+	prpl = purple_find_prpl(purple_account_get_protocol_id(account));
+	if (prpl != NULL)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+	if (prpl_info != NULL && prpl_info->icon_spec.format != NULL) {
+		if (purple_account_get_bool(account, "use-global-buddyicon", TRUE)) {
+			if (global_buddyicon != NULL)
+				buddyicon = g_object_ref(G_OBJECT(global_buddyicon));
+			/* This is for when set_account() is called for a single account */
+			else
+				img = purple_buddy_icons_find_account_icon(account);
+		} else {
 			img = purple_buddy_icons_find_account_icon(account);
-	} else {
-		img = purple_buddy_icons_find_account_icon(account);
+		}
 	}
 
 	if (img != NULL) {