cpw.malu.client_type: 622ef46b: Fixup after propagating new caps stuff

malu at pidgin.im malu at pidgin.im
Thu May 7 17:26:14 EDT 2009


-----------------------------------------------------------------
Revision: 622ef46be3dcff9f70c21918cbeed71f7508b85c
Ancestor: 1c7b89f8df6c098cf77272c0b4def033634af563
Author: malu at pidgin.im
Date: 2009-05-07T21:20:16
Branch: im.pidgin.cpw.malu.client_type
URL: http://d.pidgin.im/viewmtn/revision/info/622ef46be3dcff9f70c21918cbeed71f7508b85c

Modified files:
        libpurple/protocols/jabber/buddy.c
        libpurple/protocols/jabber/disco.c
        libpurple/protocols/jabber/jabber.c

ChangeLog: 

Fixup after propagating new caps stuff

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/buddy.c	bb2a0464aaa7924849eccbdaf3d73bd500c13e38
+++ libpurple/protocols/jabber/buddy.c	0a02fb1ca08850a7910e5e782472f21d2fb3810c
@@ -2525,10 +2525,10 @@ jabber_resource_get_identity_category_ty
 {
 	const GList *iter = NULL;
 	
-	if (jbr->caps) {
-		for (iter = jbr->caps->identities ; iter ; iter = g_list_next(iter)) {
-			const JabberCapsIdentity *identity = 
-				(JabberCapsIdentity *) iter->data;
+	if (jbr->caps.info) {
+		for (iter = jbr->caps.info->identities ; iter ; iter = g_list_next(iter)) {
+			const JabberIdentity *identity = 
+				(JabberIdentity *) iter->data;
 		
 			if (strcmp(identity->category, category) == 0) {
 				return identity->type;
============================================================
--- libpurple/protocols/jabber/disco.c	7195b4fb4d504f8266ffd1df1204663b306256a6
+++ libpurple/protocols/jabber/disco.c	18322776651a95b280954de652a32700861b377d
@@ -20,7 +20,6 @@
  */
 
 #include "internal.h"
-#include "core.h"
 #include "prefs.h"
 #include "debug.h"
 
@@ -117,40 +116,7 @@ void jabber_disco_info_parse(JabberStrea
 		if(node)
 			xmlnode_set_attrib(query, "node", node);
 
-		if(!node || g_str_equal(node, node_uri)) {
-		if(!node || !strcmp(node, CAPS0115_NODE "#" VERSION)) {
-			identity = xmlnode_new_child(query, "identity");
-			xmlnode_set_attrib(identity, "category", "client");
-			xmlnode_set_attrib(identity, "type", "pc"); /* XXX: bot, console,
-														 * handheld, pc, phone,
-														 * web */
-			xmlnode_set_attrib(identity, "name", PACKAGE);
-		}
-
 		if(!node || !strcmp(node, node_uri)) {
-		if(!node || !strcmp(node, CAPS0115_NODE "#" VERSION)) {
-			GHashTable *ui_info = purple_core_get_ui_info();
-			const gchar *ui_type = g_hash_table_lookup(ui_info, "client_type");
-			const gchar *type = "pc"; /* default client type, if unknown or
-										unspecified */
-
-			if (ui_type) {
-				if (strcmp(ui_type, "pc") == 0 ||
-					strcmp(ui_type, "console") == 0 ||
-					strcmp(ui_type, "phone") == 0 ||
-					strcmp(ui_type, "handheld") == 0 ||
-					strcmp(ui_type, "web") == 0 ||
-					strcmp(ui_type, "bot") == 0) {
-					type = ui_type;
-				}
-			}
-			identity = xmlnode_new_child(query, "identity");
-			xmlnode_set_attrib(identity, "category", "client");
-			xmlnode_set_attrib(identity, "type",  type);
-			xmlnode_set_attrib(identity, "name", PACKAGE);
-		}
-
-		if(!node || !strcmp(node, node_uri)) {
 			GList *features, *identities;
 			for(identities = jabber_identities; identities; identities = identities->next) {
 				JabberIdentity *ident = (JabberIdentity*)identities->data;
============================================================
--- libpurple/protocols/jabber/jabber.c	33c11f92e6fa66f247820e17aa5547a42958965b
+++ libpurple/protocols/jabber/jabber.c	c68de8fcc1fd1816d7e5aa0e86d29b7ee0e0ec45
@@ -23,6 +23,7 @@
 #include "account.h"
 #include "accountopt.h"
 #include "blist.h"
+#include "core.h"
 #include "cmds.h"
 #include "connection.h"
 #include "conversation.h"
@@ -3353,9 +3354,24 @@ jabber_init_plugin(PurplePlugin *plugin)
 void
 jabber_init_plugin(PurplePlugin *plugin)
 {
+	GHashTable *ui_info = purple_core_get_ui_info();
+	const gchar *ui_type = g_hash_table_lookup(ui_info, "client_type");
+	const gchar *type = "pc"; /* default client type, if unknown or 
+								unspecified */
+
+	if (ui_type) {
+		if (strcmp(ui_type, "pc") == 0 ||
+			strcmp(ui_type, "console") == 0 ||
+			strcmp(ui_type, "phone") == 0 ||
+			strcmp(ui_type, "handheld") == 0 ||
+			strcmp(ui_type, "web") == 0 ||
+			strcmp(ui_type, "bot") == 0) {
+			type = ui_type;
+		}
+	}
 	my_protocol = plugin;
 
-	jabber_add_identity("client", "pc", NULL, PACKAGE);
+	jabber_add_identity("client", type, NULL, PACKAGE);
 
 	/* initialize jabber_features list */
 	jabber_add_feature("jabber:iq:last", 0);


More information about the Commits mailing list