changeset 29917:f33da955a815

merge of '35c36f4798530acf3c07ab0acf0c5e7af98c0f48' and 'c94e3f15ffb8d4f569d41661e7a89c1c441947ce'
author Marcus Lundblad <ml@update.uu.se>
date Wed, 03 Mar 2010 22:08:35 +0000
parents 6bcf405d5c63 (diff) e3864e37e94e (current diff)
children d4c887b0cb43
files
diffstat 3 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/usermood.c	Tue Mar 02 04:40:37 2010 +0000
+++ b/libpurple/protocols/jabber/usermood.c	Wed Mar 03 22:08:35 2010 +0000
@@ -119,10 +119,6 @@
 	{NULL, NULL, NULL}
 };
 
-static PurpleMood empty_moods[] = {
-	{NULL, NULL, NULL}
-};
-
 static void jabber_mood_cb(JabberStream *js, const char *from, xmlnode *items) {
 	/* it doesn't make sense to have more than one item here, so let's just pick the first one */
 	xmlnode *item = xmlnode_get_child(items, "item");
@@ -268,6 +264,6 @@
 		return moods;
 	} else {
 		purple_debug_info("jabber", "get_moods: account doesn't support PEP\n");
-		return empty_moods;
+		return NULL;
 	}
 }
\ No newline at end of file
--- a/libpurple/prpl.h	Tue Mar 02 04:40:37 2010 +0000
+++ b/libpurple/prpl.h	Wed Mar 03 22:08:35 2010 +0000
@@ -572,7 +572,8 @@
 
 	/**
 	 * Returns an array of "PurpleMood"s, with the last one having
-	 * "mood" set to @c NULL.
+	 * "mood" set to @c NULL, or NULL if the account does not support setting
+	 * a mood.
 	 */
 	PurpleMood *(*get_moods)(PurpleAccount *account);
 };
--- a/pidgin/gtkblist.c	Tue Mar 02 04:40:37 2010 +0000
+++ b/pidgin/gtkblist.c	Wed Mar 03 22:08:35 2010 +0000
@@ -8016,8 +8016,10 @@
 		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)) {
+			if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods) &&
+			    prpl_info->get_moods(account) != NULL) {
 				GList *types;
+
 				for (types = purple_account_get_status_types(account);
 			     	types != NULL ; types = types->next) {
 					PurpleStatusType *type = types->data;