# HG changeset patch # User Nathan Walp # Date 1128433119 0 # Node ID f38655b98ba00c556ac487eb52e43539b2f2ab5c # Parent 5e3f07172dab63cbd3db8fabf8933c9e7dc0e9da [gaim-migrate @ 13880] this never made it from oldstatus to HEAD committer: Tailor Script diff -r 5e3f07172dab -r f38655b98ba0 src/protocols/jabber/jabber.c --- a/src/protocols/jabber/jabber.c Tue Oct 04 13:31:28 2005 +0000 +++ b/src/protocols/jabber/jabber.c Tue Oct 04 13:38:39 2005 +0000 @@ -945,13 +945,23 @@ static char *jabber_tooltip_text(GaimBuddy *b) { - JabberBuddy *jb = jabber_buddy_find(b->account->gc->proto_data, b->name, + JabberBuddy *jb; + GString *ret; + + g_return_val_if_fail(b != NULL, NULL); + g_return_val_if_fail(b->account != NULL, NULL); + g_return_val_if_fail(b->account->gc != NULL, NULL); + g_return_val_if_fail(b->account->gc->proto_data != NULL, NULL); + + jb = jabber_buddy_find(b->account->gc->proto_data, b->name, FALSE); - GString *ret = g_string_new(""); + ret = g_string_new(""); if(jb) { - JabberBuddyResource *jbr = jabber_buddy_find_resource(jb, NULL); + JabberBuddyResource *jbr = NULL; const char *sub; + GList *l; + if(jb->subscription & JABBER_SUB_FROM) { if(jb->subscription & JABBER_SUB_TO) sub = _("Both"); @@ -969,8 +979,12 @@ } g_string_append_printf(ret, "\n%s: %s", _("Subscription"), sub); - if(jbr) { + for(l=jb->resources; l; l = l->next) { char *text = NULL; + char *res = NULL; + + jbr = l->data; + if(jbr->status) { char *stripped; stripped = gaim_markup_strip_html(jbr->status); @@ -979,14 +993,22 @@ /* XXX: need some nl to br love here */ } - g_string_append_printf(ret, "\n%s: %s%s%s", + if(jbr->name) + res = g_strdup_printf(" _(%s)", jbr->name); + + g_string_append_printf(ret, "\n%s%s: %s%s%s", _("Status"), + res ? res : "", jabber_buddy_state_get_name(jbr->state), text ? ": " : "", text ? text : ""); if(text) g_free(text); - } else if(!GAIM_BUDDY_IS_ONLINE(b) && jb->error_msg) { + if(res) + g_free(res); + } + + if(!GAIM_BUDDY_IS_ONLINE(b) && jb->error_msg) { g_string_append_printf(ret, "\n%s: %s", _("Error"), jb->error_msg); }