pidgin: ab66445e: If the status name and status message ar...
evands at pidgin.im
evands at pidgin.im
Fri May 30 10:46:00 EDT 2008
-----------------------------------------------------------------
Revision: ab66445eb86efd6fff03037f48de889122a2b07d
Ancestor: eeed2c960a1dbe213de63e3115629056ac809beb
Author: evands at pidgin.im
Date: 2008-05-30T14:40:10
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/ab66445eb86efd6fff03037f48de889122a2b07d
Modified files:
libpurple/protocols/jabber/buddy.c
ChangeLog:
If the status name and status message are the same for a jabber buddy,
don't duplicate the information when displaying the Get Info window.
(e.g. "Status: Away: Away")
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/buddy.c 557cc6c006b4f122764d8b90547958d8c148bae3
+++ libpurple/protocols/jabber/buddy.c e0c5c843c37ca7e37813e88635b0d909dc78c60c
@@ -824,10 +824,14 @@ static void jabber_buddy_info_show_if_re
}
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 @@ static void jabber_buddy_info_show_if_re
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 @@ static void jabber_buddy_info_show_if_re
}
}
+ 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);
More information about the Commits
mailing list