changeset 26982:007dff3cb9e4

Fixup after propagating new caps stuff
author Marcus Lundblad <ml@update.uu.se>
date Thu, 07 May 2009 21:20:16 +0000
parents 84325b6e3568
children 2dfb639b4f26
files libpurple/protocols/jabber/buddy.c libpurple/protocols/jabber/disco.c libpurple/protocols/jabber/jabber.c
diffstat 3 files changed, 21 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/buddy.c	Thu May 07 20:34:50 2009 +0000
+++ b/libpurple/protocols/jabber/buddy.c	Thu May 07 21:20:16 2009 +0000
@@ -2525,10 +2525,10 @@
 {
 	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;
--- a/libpurple/protocols/jabber/disco.c	Thu May 07 20:34:50 2009 +0000
+++ b/libpurple/protocols/jabber/disco.c	Thu May 07 21:20:16 2009 +0000
@@ -20,7 +20,6 @@
  */
 
 #include "internal.h"
-#include "core.h"
 #include "prefs.h"
 #include "debug.h"
 
@@ -117,39 +116,6 @@
 		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) {
--- a/libpurple/protocols/jabber/jabber.c	Thu May 07 20:34:50 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Thu May 07 21:20:16 2009 +0000
@@ -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 @@
 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);