Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/jabber.c @ 26773:803e05b3a871
Retrieve status message to display in Buddy List from PurplePresence.
JabberBuddyResources are not tracked when they go offline, so this would
return NULL if all resources are offline. In either case, the function
returned the status message from the highest priority resource, which is also
the one in the PurplePresence.
Closes #1420.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Sun, 26 Apr 2009 03:18:07 +0000 |
parents | 90d5e3b94a37 |
children | bbf174c5d331 09e9b7e50df9 02624b4a7552 4548c114e953 |
comparison
equal
deleted
inserted
replaced
26772:0054bf136314 | 26773:803e05b3a871 |
---|---|
1699 if(jb && !PURPLE_BUDDY_IS_ONLINE(b) && (jb->subscription & JABBER_SUB_PENDING || !(jb->subscription & JABBER_SUB_TO))) { | 1699 if(jb && !PURPLE_BUDDY_IS_ONLINE(b) && (jb->subscription & JABBER_SUB_PENDING || !(jb->subscription & JABBER_SUB_TO))) { |
1700 ret = g_strdup(_("Not Authorized")); | 1700 ret = g_strdup(_("Not Authorized")); |
1701 } else if(jb && !PURPLE_BUDDY_IS_ONLINE(b) && jb->error_msg) { | 1701 } else if(jb && !PURPLE_BUDDY_IS_ONLINE(b) && jb->error_msg) { |
1702 ret = g_strdup(jb->error_msg); | 1702 ret = g_strdup(jb->error_msg); |
1703 } else { | 1703 } else { |
1704 PurplePresence *presence = purple_buddy_get_presence(b); | |
1705 PurpleStatus *status =purple_presence_get_active_status(presence); | |
1704 char *stripped; | 1706 char *stripped; |
1705 | 1707 |
1706 if(!(stripped = purple_markup_strip_html(jabber_buddy_get_status_msg(jb)))) { | 1708 if(!(stripped = purple_markup_strip_html(purple_status_get_attr_string(status, "message")))) { |
1707 PurplePresence *presence = purple_buddy_get_presence(b); | |
1708 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { | 1709 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { |
1709 PurpleStatus *status = purple_presence_get_status(presence, "tune"); | 1710 PurpleStatus *status = purple_presence_get_status(presence, "tune"); |
1710 stripped = g_strdup(purple_status_get_attr_string(status, PURPLE_TUNE_TITLE)); | 1711 stripped = g_strdup(purple_status_get_attr_string(status, PURPLE_TUNE_TITLE)); |
1711 } | 1712 } |
1712 } | 1713 } |