Mercurial > pidgin.yaz
diff libpurple/protocols/jabber/jabber.c @ 26779:bbf174c5d331
propagate from branch 'im.pidgin.pidgin' (head 371b6104658ad98c418ac711643192c2e34428ea)
to branch 'im.pidgin.cpw.malu.client_type' (head fe7a27aab708bdcffc946a3c059459b4293ccdc3)
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Sun, 26 Apr 2009 18:27:30 +0000 |
parents | 803e05b3a871 74dcea0f8457 |
children | 98ff7c538e48 |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c Sun Apr 26 17:01:05 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sun Apr 26 18:27:30 2009 +0000 @@ -1670,7 +1670,7 @@ JabberStream *js; JabberBuddy *jb = NULL; PurpleConnection *gc = purple_account_get_connection(purple_buddy_get_account(b)); - + if(!gc) return NULL; @@ -1683,6 +1683,28 @@ !(jb->subscription & JABBER_SUB_TO))) return "not-authorized"; } + + if (jb) { + JabberBuddyResource *jbr = jabber_buddy_find_resource(jb, NULL); + if (jbr) { + const gchar *client_type = + jabber_resource_get_identity_category_type(jbr, "client"); + + if (client_type) { + if (strcmp(client_type, "phone") == 0) { + return "mobile"; + } else if (strcmp(client_type, "web") == 0) { + return "external"; + } else if (strcmp(client_type, "handheld") == 0) { + return "hiptop"; + } else if (strcmp(client_type, "bot") == 0) { + return "bot"; + } + /* the default value "pc" falls through and has no emblem */ + } + } + } + return NULL; }