comparison libpurple/protocols/jabber/jabber.c @ 27593:6b1eb8dbf86e

Identify clients in XMPP caps based on the ui_info hash. Closes #9672.
author Paul Aurich <paul@darkrain42.org>
date Sun, 12 Jul 2009 22:42:44 +0000
parents 4cddfd2d06be
children a12574d982a1
comparison
equal deleted inserted replaced
27592:4cddfd2d06be 27593:6b1eb8dbf86e
3437 void 3437 void
3438 jabber_init_plugin(PurplePlugin *plugin) 3438 jabber_init_plugin(PurplePlugin *plugin)
3439 { 3439 {
3440 GHashTable *ui_info = purple_core_get_ui_info(); 3440 GHashTable *ui_info = purple_core_get_ui_info();
3441 const gchar *ui_type; 3441 const gchar *ui_type;
3442 const gchar *type = "pc"; /* default client type, if unknown or 3442 const gchar *type = "pc"; /* default client type, if unknown or
3443 unspecified */ 3443 unspecified */
3444 const gchar *ui_name = NULL;
3444 3445
3445 jabber_plugin = plugin; 3446 jabber_plugin = plugin;
3446 3447
3447 ui_type = ui_info ? g_hash_table_lookup(ui_info, "client_type") : NULL; 3448 ui_type = ui_info ? g_hash_table_lookup(ui_info, "client_type") : NULL;
3448 if (ui_type) { 3449 if (ui_type) {
3454 strcmp(ui_type, "bot") == 0) { 3455 strcmp(ui_type, "bot") == 0) {
3455 type = ui_type; 3456 type = ui_type;
3456 } 3457 }
3457 } 3458 }
3458 3459
3459 jabber_add_identity("client", type, NULL, PACKAGE); 3460 if (ui_info)
3461 ui_name = g_hash_table_lookup(ui_info, "name");
3462 if (ui_name == NULL)
3463 ui_name = PACKAGE;
3464
3465 jabber_add_identity("client", type, NULL, ui_name);
3460 3466
3461 /* initialize jabber_features list */ 3467 /* initialize jabber_features list */
3462 jabber_add_feature("jabber:iq:last", 0); 3468 jabber_add_feature("jabber:iq:last", 0);
3463 jabber_add_feature("jabber:iq:oob", 0); 3469 jabber_add_feature("jabber:iq:oob", 0);
3464 jabber_add_feature("urn:xmpp:time", 0); 3470 jabber_add_feature("urn:xmpp:time", 0);