pidgin: 93e8d477: Added PurpleConnection flags to determin...

malu at pidgin.im malu at pidgin.im
Thu Mar 4 17:15:50 EST 2010


-----------------------------------------------------------------
Revision: 93e8d47716fec9d6fb1ec7441802a3cca9c02b73
Ancestor: 3762c9332c14ac3b681bae2c99c49773c2e46e8a
Author: malu at pidgin.im
Date: 2010-03-04T22:14:03
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/93e8d47716fec9d6fb1ec7441802a3cca9c02b73

Modified files:
        libpurple/connection.h libpurple/protocols/jabber/disco.c
        libpurple/protocols/oscar/oscar.c pidgin/gtkblist.c

ChangeLog: 

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).

-------------- next part --------------
============================================================
--- libpurple/connection.h	cfdfac3c36755b5c278f720e5d4a8befa852bb25
+++ libpurple/connection.h	951499e579935f8e24497d558ca22b912eb46d5e
@@ -44,8 +44,9 @@ typedef enum
 	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
============================================================
--- libpurple/protocols/jabber/disco.c	cafcb26b37cba8a9fe428d442e5aaca199b4dbb6
+++ libpurple/protocols/jabber/disco.c	286a227929ab79f327026aed65bcc9d1adf1a13c
@@ -517,8 +517,12 @@ jabber_disco_server_info_result_cb(Jabbe
 		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"))
============================================================
--- libpurple/protocols/oscar/oscar.c	5bc820ea79cc2e3f0a94b37d28279f2938d2f462
+++ libpurple/protocols/oscar/oscar.c	9a28897ede68592051736c0a1073613f68a4c730
@@ -1573,6 +1573,7 @@ oscar_login(PurpleAccount *account)
 
 	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;
============================================================
--- pidgin/gtkblist.c	8928b4e76884abeca0abd7d6dccaf3ff5158dabb
+++ pidgin/gtkblist.c	d1add4c3d4bbbc4fe806b6a1f7d894015a48b8c1
@@ -8017,7 +8017,7 @@ pidgin_blist_update_accounts_menu(void)
 		    (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);


More information about the Commits mailing list