Mercurial > pidgin
diff src/protocols/jabber/jabber.c @ 11609:f38655b98ba0
[gaim-migrate @ 13880]
this never made it from oldstatus to HEAD
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Tue, 04 Oct 2005 13:38:39 +0000 |
parents | ea98c27f1a34 |
children | 69bd7af50d31 |
line wrap: on
line diff
--- 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<b>%s:</b> %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<b>%s:</b> %s%s%s", + if(jbr->name) + res = g_strdup_printf(" _(%s)", jbr->name); + + g_string_append_printf(ret, "\n<b>%s%s:</b> %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<b>%s:</b> %s", _("Error"), jb->error_msg); }