# HG changeset patch # User Marcus Lundblad # Date 1241731216 0 # Node ID 007dff3cb9e40c7c0033ec887c92126a23e79eec # Parent 84325b6e356873d0c4e439d893edac89dec54356 Fixup after propagating new caps stuff diff -r 84325b6e3568 -r 007dff3cb9e4 libpurple/protocols/jabber/buddy.c --- 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; diff -r 84325b6e3568 -r 007dff3cb9e4 libpurple/protocols/jabber/disco.c --- 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) { diff -r 84325b6e3568 -r 007dff3cb9e4 libpurple/protocols/jabber/jabber.c --- 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);