From: Nathan W. <fac...@us...> - 2005-10-04 13:38:53
|
Update of /cvsroot/gaim/gaim/src/protocols/jabber In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21826/src/protocols/jabber Modified Files: jabber.c Log Message: this never made it from oldstatus to HEAD Index: jabber.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/jabber/jabber.c,v retrieving revision 1.300 retrieving revision 1.301 diff -u -d -p -r1.300 -r1.301 --- jabber.c 26 Sep 2005 01:07:53 -0000 1.300 +++ jabber.c 4 Oct 2005 13:38:39 -0000 1.301 @@ -945,13 +945,23 @@ static char *jabber_status_text(GaimBudd 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 @@ static char *jabber_tooltip_text(GaimBud } 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 @@ static char *jabber_tooltip_text(GaimBud /* 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); } |