pidgin: bb19f6d7: Retrieve status message to display in Bu...
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Sun Apr 26 13:05:53 EDT 2009
-----------------------------------------------------------------
Revision: bb19f6d711627c93fbf88166c7b2275059258762
Ancestor: 120a0724eaee9fda26198bc2f9f1e8c63ac6557b
Author: darkrain42 at pidgin.im
Date: 2009-04-26T03:18:07
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/bb19f6d711627c93fbf88166c7b2275059258762
Modified files:
libpurple/protocols/jabber/buddy.c
libpurple/protocols/jabber/buddy.h
libpurple/protocols/jabber/jabber.c
ChangeLog:
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.
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/buddy.c 62f03dd797303c511a1ffebe46b41c4baac26539
+++ libpurple/protocols/jabber/buddy.c b1d9cd05359d8b0e2db4b55a8b1e2753820c9320
@@ -202,21 +202,6 @@ void jabber_buddy_remove_resource(Jabber
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
============================================================
--- libpurple/protocols/jabber/buddy.h 8d1fa59e5c9fa698b5cf0d3322397fefed9c4615
+++ libpurple/protocols/jabber/buddy.h 12b0899d210c693619fc3aa2c26b22afdfff5c2b
@@ -96,7 +96,6 @@ void jabber_buddy_remove_resource(Jabber
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);
============================================================
--- libpurple/protocols/jabber/jabber.c 5e95536dd9b4bbda6dd99a741d89765b2fb7355b
+++ libpurple/protocols/jabber/jabber.c dcd7124339520a90e0555419d69dd7e5f7e199fe
@@ -1701,10 +1701,11 @@ char *jabber_status_text(PurpleBuddy *b)
} 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));
More information about the Commits
mailing list