| 1856 if(!PURPLE_BUDDY_IS_ONLINE(b)) { |
1857 if(!PURPLE_BUDDY_IS_ONLINE(b)) { |
| 1857 if(jb && (jb->subscription & JABBER_SUB_PENDING || |
1858 if(jb && (jb->subscription & JABBER_SUB_PENDING || |
| 1858 !(jb->subscription & JABBER_SUB_TO))) |
1859 !(jb->subscription & JABBER_SUB_TO))) |
| 1859 return "not-authorized"; |
1860 return "not-authorized"; |
| 1860 } |
1861 } |
| |
1862 |
| |
1863 if (jb) { |
| |
1864 JabberBuddyResource *jbr = jabber_buddy_find_resource(jb, NULL); |
| |
1865 if (jbr) { |
| |
1866 const gchar *client_type = |
| |
1867 jabber_resource_get_identity_category_type(jbr, "client"); |
| |
1868 |
| |
1869 if (client_type) { |
| |
1870 if (strcmp(client_type, "phone") == 0) { |
| |
1871 return "mobile"; |
| |
1872 } else if (strcmp(client_type, "web") == 0) { |
| |
1873 return "external"; |
| |
1874 } else if (strcmp(client_type, "handheld") == 0) { |
| |
1875 return "hiptop"; |
| |
1876 } else if (strcmp(client_type, "bot") == 0) { |
| |
1877 return "bot"; |
| |
1878 } |
| |
1879 /* the default value "pc" falls through and has no emblem */ |
| |
1880 } |
| |
1881 } |
| |
1882 } |
| |
1883 |
| 1861 return NULL; |
1884 return NULL; |
| 1862 } |
1885 } |
| 1863 |
1886 |
| 1864 char *jabber_status_text(PurpleBuddy *b) |
1887 char *jabber_status_text(PurpleBuddy *b) |
| 1865 { |
1888 { |
| 3329 } |
3352 } |
| 3330 |
3353 |
| 3331 void |
3354 void |
| 3332 jabber_init_plugin(PurplePlugin *plugin) |
3355 jabber_init_plugin(PurplePlugin *plugin) |
| 3333 { |
3356 { |
| |
3357 GHashTable *ui_info = purple_core_get_ui_info(); |
| |
3358 const gchar *ui_type = g_hash_table_lookup(ui_info, "client_type"); |
| |
3359 const gchar *type = "pc"; /* default client type, if unknown or |
| |
3360 unspecified */ |
| |
3361 |
| |
3362 if (ui_type) { |
| |
3363 if (strcmp(ui_type, "pc") == 0 || |
| |
3364 strcmp(ui_type, "console") == 0 || |
| |
3365 strcmp(ui_type, "phone") == 0 || |
| |
3366 strcmp(ui_type, "handheld") == 0 || |
| |
3367 strcmp(ui_type, "web") == 0 || |
| |
3368 strcmp(ui_type, "bot") == 0) { |
| |
3369 type = ui_type; |
| |
3370 } |
| |
3371 } |
| 3334 my_protocol = plugin; |
3372 my_protocol = plugin; |
| 3335 |
3373 |
| 3336 jabber_add_identity("client", "pc", NULL, PACKAGE); |
3374 jabber_add_identity("client", type, NULL, PACKAGE); |
| 3337 |
3375 |
| 3338 /* initialize jabber_features list */ |
3376 /* initialize jabber_features list */ |
| 3339 jabber_add_feature("jabber:iq:last", 0); |
3377 jabber_add_feature("jabber:iq:last", 0); |
| 3340 jabber_add_feature("jabber:iq:oob", 0); |
3378 jabber_add_feature("jabber:iq:oob", 0); |
| 3341 jabber_add_feature("jabber:iq:time", 0); |
3379 jabber_add_feature("jabber:iq:time", 0); |