Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/jabber.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 | 256fbe98f6be |
children | 3a0c2526364f |
comparison
equal
deleted
inserted
replaced
25070:cddd7961901f | 25836:1d3274111180 |
---|---|
1618 | 1618 |
1619 const char* jabber_list_emblem(PurpleBuddy *b) | 1619 const char* jabber_list_emblem(PurpleBuddy *b) |
1620 { | 1620 { |
1621 JabberStream *js; | 1621 JabberStream *js; |
1622 JabberBuddy *jb = NULL; | 1622 JabberBuddy *jb = NULL; |
1623 | 1623 |
1624 if(!b->account->gc) | 1624 if(!b->account->gc) |
1625 return NULL; | 1625 return NULL; |
1626 | 1626 |
1627 js = b->account->gc->proto_data; | 1627 js = b->account->gc->proto_data; |
1628 if(js) | 1628 if(js) |
1631 if(!PURPLE_BUDDY_IS_ONLINE(b)) { | 1631 if(!PURPLE_BUDDY_IS_ONLINE(b)) { |
1632 if(jb && (jb->subscription & JABBER_SUB_PENDING || | 1632 if(jb && (jb->subscription & JABBER_SUB_PENDING || |
1633 !(jb->subscription & JABBER_SUB_TO))) | 1633 !(jb->subscription & JABBER_SUB_TO))) |
1634 return "not-authorized"; | 1634 return "not-authorized"; |
1635 } | 1635 } |
1636 | |
1637 if (jb) { | |
1638 JabberBuddyResource *jbr = jabber_buddy_find_resource(jb, NULL); | |
1639 if (jbr) { | |
1640 const gchar *client_type = | |
1641 jabber_resource_get_identity_category_type(jbr, "client"); | |
1642 | |
1643 if (client_type) { | |
1644 if (strcmp(client_type, "phone") == 0) { | |
1645 return "mobile"; | |
1646 } else if (strcmp(client_type, "web") == 0) { | |
1647 return "external"; | |
1648 } else if (strcmp(client_type, "handheld") == 0) { | |
1649 return "hiptop"; | |
1650 } else if (strcmp(client_type, "bot") == 0) { | |
1651 return "bot"; | |
1652 } | |
1653 /* the default value "pc" falls through and has no emblem */ | |
1654 } | |
1655 } | |
1656 } | |
1657 | |
1636 return NULL; | 1658 return NULL; |
1637 } | 1659 } |
1638 | 1660 |
1639 char *jabber_status_text(PurpleBuddy *b) | 1661 char *jabber_status_text(PurpleBuddy *b) |
1640 { | 1662 { |