# HG changeset patch # User Marcus Lundblad # Date 1267740843 0 # Node ID 3e5bb4e2334c07ec58922cfa8549ff24ee98ead8 # Parent cead5610c89a7a535bf655c259331ad5294518bc Added PurpleConnection flags to determine support for moods and mood messages. Mood messages is yet to be implemented in the UI (and replacing the current account-specific mood setting for XMPP). diff -r cead5610c89a -r 3e5bb4e2334c libpurple/connection.h --- a/libpurple/connection.h Thu Mar 04 21:25:50 2010 +0000 +++ b/libpurple/connection.h Thu Mar 04 22:14:03 2010 +0000 @@ -44,8 +44,9 @@ PURPLE_CONNECTION_NO_FONTSIZE = 0x0020, /**< Connection does not send/receive font sizes */ PURPLE_CONNECTION_NO_URLDESC = 0x0040, /**< Connection does not support descriptions with links */ PURPLE_CONNECTION_NO_IMAGES = 0x0080, /**< Connection does not support sending of images */ - PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY = 0x0100 /**< Connection supports sending and receiving custom smileys */ - + PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY = 0x0100, /**< Connection supports sending and receiving custom smileys */ + PURPLE_CONNECTION_SUPPORT_MOODS = 0x0200, /**< Connection supports setting moods */ + PURPLE_CONNECTION_SUPPORT_MOOD_MESSAGES = 0x0400 /**< Connection supports setting a message on moods */ } PurpleConnectionFlags; typedef enum diff -r cead5610c89a -r 3e5bb4e2334c libpurple/protocols/jabber/disco.c --- a/libpurple/protocols/jabber/disco.c Thu Mar 04 21:25:50 2010 +0000 +++ b/libpurple/protocols/jabber/disco.c Thu Mar 04 22:14:03 2010 +0000 @@ -517,8 +517,12 @@ const char *category, *type, *name; category = xmlnode_get_attrib(child, "category"); type = xmlnode_get_attrib(child, "type"); - if(category && type && !strcmp(category, "pubsub") && !strcmp(type,"pep")) + if(category && type && !strcmp(category, "pubsub") && !strcmp(type,"pep")) { + PurpleConnection *gc = js->gc; js->pep = TRUE; + gc->flags |= PURPLE_CONNECTION_SUPPORT_MOODS | + PURPLE_CONNECTION_SUPPORT_MOOD_MESSAGES; + } if (!category || strcmp(category, "server")) continue; if (!type || strcmp(type, "im")) diff -r cead5610c89a -r 3e5bb4e2334c libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Thu Mar 04 21:25:50 2010 +0000 +++ b/libpurple/protocols/oscar/oscar.c Thu Mar 04 22:14:03 2010 +0000 @@ -1573,6 +1573,7 @@ if (oscar_util_valid_name_icq((purple_account_get_username(account)))) { od->icq = TRUE; + gc->flags |= PURPLE_CONNECTION_SUPPORT_MOODS; } else { gc->flags |= PURPLE_CONNECTION_HTML; gc->flags |= PURPLE_CONNECTION_AUTO_RESP; diff -r cead5610c89a -r 3e5bb4e2334c pidgin/gtkblist.c --- a/pidgin/gtkblist.c Thu Mar 04 21:25:50 2010 +0000 +++ b/pidgin/gtkblist.c Thu Mar 04 22:14:03 2010 +0000 @@ -8017,7 +8017,7 @@ (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods) || PURPLE_PLUGIN_HAS_ACTIONS(plugin))) { if (PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods) && - prpl_info->get_moods(account) != NULL) { + gc->flags & PURPLE_CONNECTION_SUPPORT_MOODS) { GList *types; for (types = purple_account_get_status_types(account);