Mercurial > pidgin
changeset 23252:a67467e5a586
merge of '6c9b241a178cbf5a0760ba9646e0460067db378a'
and 'ab66445eb86efd6fff03037f48de889122a2b07d'
author | Stu Tomlinson <stu@nosnilmot.com> |
---|---|
date | Fri, 30 May 2008 19:45:46 +0000 |
parents | b020c310355a (current diff) 4f49d4b25e24 (diff) |
children | 5bbd0328626b |
files | |
diffstat | 1 files changed, 14 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/buddy.c Fri May 30 19:26:10 2008 +0000 +++ b/libpurple/protocols/jabber/buddy.c Fri May 30 19:45:46 2008 +0000 @@ -824,10 +824,14 @@ } if(jbr) { char *purdy = NULL; + char *status_name = jabber_buddy_state_get_name(jbr->state); if(jbr->status) purdy = purple_strdup_withhtml(jbr->status); - tmp = g_strdup_printf("%s%s%s", jabber_buddy_state_get_name(jbr->state), - (purdy ? ": " : ""), + if(status_name && purdy && !strcmp(status_name, purdy)) + status_name = NULL; + + tmp = g_strdup_printf("%s%s%s", (status_name ? status_name : ""), + ((status_name && purdy) ? ": " : ""), (purdy ? purdy : "")); purple_notify_user_info_prepend_pair(user_info, _("Status"), tmp); g_free(tmp); @@ -963,7 +967,8 @@ gboolean multiple_resources = jbi->jb->resources && (g_list_length(jbi->jb->resources) > 1); for(resources = jbi->jb->resources; resources; resources = resources->next) { - char *purdy = NULL; + char *purdy = NULL, *status_name = NULL; + jbr = resources->data; if(jbr->client.name) { @@ -987,10 +992,14 @@ } } + status_name = jabber_buddy_state_get_name(jbr->state); if(jbr->status) purdy = purple_strdup_withhtml(jbr->status); - tmp = g_strdup_printf("%s%s%s", jabber_buddy_state_get_name(jbr->state), - (purdy ? ": " : ""), + if(status_name && purdy && !strcmp(status_name, purdy)) + status_name = NULL; + + tmp = g_strdup_printf("%s%s%s", (status_name ? status_name : ""), + ((status_name && purdy) ? ": " : ""), (purdy ? purdy : "")); purple_notify_user_info_prepend_pair(user_info, _("Status"), tmp); g_free(tmp);