Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/disco.c @ 25836:1d3274111180
Set a value "type" in the ui_info hash table
Set client type in resonse to an XMPP XEP-0115 request (client type).
Makes Pidgin report itself as "pc", Finch as "console"
Display emblems on XMPP buddies corresponding to their client type
(if available). Currently there is no emblem for "console"
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Mon, 09 Feb 2009 21:21:18 +0000 |
parents | 0700833f0c5d |
children | a95eed74fdd7 |
comparison
equal
deleted
inserted
replaced
25070:cddd7961901f | 25836:1d3274111180 |
---|---|
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") |