# HG changeset patch # User Paul Aurich # Date 1240715887 0 # Node ID 803e05b3a871cf472d5f1d66c9341c196b66c55b # Parent 0054bf1363146d24746e8693b88640c560fc8e15 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. diff -r 0054bf136314 -r 803e05b3a871 libpurple/protocols/jabber/buddy.c --- a/libpurple/protocols/jabber/buddy.c Sun Apr 26 02:27:08 2009 +0000 +++ b/libpurple/protocols/jabber/buddy.c Sun Apr 26 03:18:07 2009 +0000 @@ -202,21 +202,6 @@ jabber_buddy_resource_free(jbr); } -const char *jabber_buddy_get_status_msg(JabberBuddy *jb) -{ - JabberBuddyResource *jbr; - - if(!jb) - return NULL; - - jbr = jabber_buddy_find_resource(jb, NULL); - - if(!jbr) - return NULL; - - return jbr->status; -} - /******* * This is the old vCard stuff taken from the old prpl. vCards, by definition * are a temporary thing until jabber can get its act together and come up diff -r 0054bf136314 -r 803e05b3a871 libpurple/protocols/jabber/buddy.h --- a/libpurple/protocols/jabber/buddy.h Sun Apr 26 02:27:08 2009 +0000 +++ b/libpurple/protocols/jabber/buddy.h Sun Apr 26 03:18:07 2009 +0000 @@ -96,7 +96,6 @@ int priority, JabberBuddyState state, const char *status); void jabber_buddy_resource_free(JabberBuddyResource *jbr); void jabber_buddy_remove_resource(JabberBuddy *jb, const char *resource); -const char *jabber_buddy_get_status_msg(JabberBuddy *jb); void jabber_buddy_get_info(PurpleConnection *gc, const char *who); GList *jabber_blist_node_menu(PurpleBlistNode *node); diff -r 0054bf136314 -r 803e05b3a871 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Sun Apr 26 02:27:08 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sun Apr 26 03:18:07 2009 +0000 @@ -1701,10 +1701,11 @@ } else if(jb && !PURPLE_BUDDY_IS_ONLINE(b) && jb->error_msg) { ret = g_strdup(jb->error_msg); } else { + PurplePresence *presence = purple_buddy_get_presence(b); + PurpleStatus *status =purple_presence_get_active_status(presence); char *stripped; - if(!(stripped = purple_markup_strip_html(jabber_buddy_get_status_msg(jb)))) { - PurplePresence *presence = purple_buddy_get_presence(b); + if(!(stripped = purple_markup_strip_html(purple_status_get_attr_string(status, "message")))) { if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { PurpleStatus *status = purple_presence_get_status(presence, "tune"); stripped = g_strdup(purple_status_get_attr_string(status, PURPLE_TUNE_TITLE));