# HG changeset patch # User Marcus Lundblad # Date 1267654107 0 # Node ID 6bcf405d5c63229fd36461e9f1c63cf4483b6612 # Parent 27a94015e239df514f7c8047c7213eeed72d60e4 Allow a PRPL to have get_moods return NULL to disable mood setting. Fixes not showing the "Set Mood" menu for XMPP accounts not supporting PEP such as gmail.com diff -r 27a94015e239 -r 6bcf405d5c63 libpurple/protocols/jabber/usermood.c --- a/libpurple/protocols/jabber/usermood.c Sun Feb 28 22:30:02 2010 +0000 +++ b/libpurple/protocols/jabber/usermood.c Wed Mar 03 22:08:27 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 diff -r 27a94015e239 -r 6bcf405d5c63 libpurple/prpl.h --- a/libpurple/prpl.h Sun Feb 28 22:30:02 2010 +0000 +++ b/libpurple/prpl.h Wed Mar 03 22:08:27 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); }; diff -r 27a94015e239 -r 6bcf405d5c63 pidgin/gtkblist.c --- a/pidgin/gtkblist.c Sun Feb 28 22:30:02 2010 +0000 +++ b/pidgin/gtkblist.c Wed Mar 03 22:08:27 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;