changeset 29858:2cccb8588c12

Resurrect the PRPL actions to show up in the account submenu
author Marcus Lundblad <ml@update.uu.se>
date Mon, 08 Feb 2010 21:50:15 +0000
parents f3654983e1da
children 9b4b5bdc57d8
files pidgin/gtkblist.c
diffstat 1 files changed, 27 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Mon Feb 08 21:38:26 2010 +0000
+++ b/pidgin/gtkblist.c	Mon Feb 08 21:50:15 2010 +0000
@@ -8150,38 +8150,36 @@
 
 		gc = purple_account_get_connection(account);
 		plugin = gc && PURPLE_CONNECTION_IS_CONNECTED(gc) ? gc->prpl : NULL;
-
-		if (plugin &&
-		    (prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(plugin)) &&
-		    PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods))
-		{
-			GList *types;
-			for (types = purple_account_get_status_types(account);
-			     types != NULL ; types = types->next)
-			{
-				PurpleStatusType *type = types->data;
-
-				if (strcmp(purple_status_type_get_id(type), "mood") != 0)
-					continue;
-
-				menuitem = gtk_menu_item_new_with_mnemonic(_("Set _Mood..."));
-				g_signal_connect(G_OBJECT(menuitem), "activate",
-					         G_CALLBACK(set_mood_cb), account);
-				gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem);
-
-				/* Be safe.  It shouldn't match more than once anyway */
-				break;
+		prpl_info = plugin ? PURPLE_PLUGIN_PROTOCOL_INFO(plugin) : NULL;
+		
+		if (prpl_info &&
+		    (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods) ||
+			 PURPLE_PLUGIN_HAS_ACTIONS(plugin))) {
+			if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods)) {
+				GList *types;
+				for (types = purple_account_get_status_types(account);
+			     	types != NULL ; types = types->next) {
+					PurpleStatusType *type = types->data;
+
+					if (strcmp(purple_status_type_get_id(type), "mood") != 0)
+						continue;
+
+					menuitem = gtk_menu_item_new_with_mnemonic(_("Set _Mood..."));
+					g_signal_connect(G_OBJECT(menuitem), "activate",
+					         	G_CALLBACK(set_mood_cb), account);
+					gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem);
+
+					/* Be safe.  It shouldn't match more than once anyway */
+					break;
+				}
 			}
-		}
-		else
-		{
-			if (plugin && PURPLE_PLUGIN_HAS_ACTIONS(plugin)) {
+			if (PURPLE_PLUGIN_HAS_ACTIONS(plugin)) {
 				build_plugin_actions(submenu, plugin, gc);
-			} else {
-				menuitem = gtk_menu_item_new_with_label(_("No actions available"));
-				gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem);
-				gtk_widget_set_sensitive(menuitem, FALSE);
 			}
+		} else {
+			menuitem = gtk_menu_item_new_with_label(_("No actions available"));
+			gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem);
+			gtk_widget_set_sensitive(menuitem, FALSE);
 		}
 
 		pidgin_separator(submenu);