libpurple/protocols/jabber/disco.c

branch
cpw.malu.client_type
changeset 25577
ca0b40451bbc
parent 25290
033942580f51
child 25578
c0c1b73f4fb1
equal deleted inserted replaced
25576:c49c7da93426 25577:ca0b40451bbc
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
19 * 19 *
20 */ 20 */
21 21
22 #include "internal.h" 22 #include "internal.h"
23 #include "core.h"
23 #include "prefs.h" 24 #include "prefs.h"
24 #include "debug.h" 25 #include "debug.h"
25 26
26 #include "buddy.h" 27 #include "buddy.h"
27 #include "google.h" 28 #include "google.h"
114 115
115 if(node) 116 if(node)
116 xmlnode_set_attrib(query, "node", node); 117 xmlnode_set_attrib(query, "node", node);
117 118
118 if(!node || !strcmp(node, CAPS0115_NODE "#" VERSION)) { 119 if(!node || !strcmp(node, CAPS0115_NODE "#" VERSION)) {
120 GHashTable *ui_info = purple_core_get_ui_info();
121 const gchar *ui_type = g_hash_table_lookup(ui_info, "type");
122 const gchar *type = "pc"; /* default client type, if unknown or
123 unspecified */
124
125 if (ui_type) {
126 if (strcmp(ui_type, "pc") == 0 ||
127 strcmp(ui_type, "console") == 0 ||
128 strcmp(ui_type, "phone") == 0 ||
129 strcmp(ui_type, "handheld") == 0 ||
130 strcmp(ui_type, "web") == 0 ||
131 strcmp(ui_type, "bot") == 0) {
132 type = ui_type;
133 }
134 }
119 identity = xmlnode_new_child(query, "identity"); 135 identity = xmlnode_new_child(query, "identity");
120 xmlnode_set_attrib(identity, "category", "client"); 136 xmlnode_set_attrib(identity, "category", "client");
121 xmlnode_set_attrib(identity, "type", "pc"); /* XXX: bot, console, 137 xmlnode_set_attrib(identity, "type", type);
122 * handheld, pc, phone,
123 * web */
124 xmlnode_set_attrib(identity, "name", PACKAGE); 138 xmlnode_set_attrib(identity, "name", PACKAGE);
125 139
126 SUPPORT_FEATURE("jabber:iq:last") 140 SUPPORT_FEATURE("jabber:iq:last")
127 SUPPORT_FEATURE("jabber:iq:oob") 141 SUPPORT_FEATURE("jabber:iq:oob")
128 SUPPORT_FEATURE("jabber:iq:time") 142 SUPPORT_FEATURE("jabber:iq:time")

mercurial