changeset 12944:07eaae27e674

[gaim-migrate @ 15297] I hate seeing Jabber statuses (from Adium, IIRC) that say: "Away: Away" committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 19 Jan 2006 07:06:19 +0000
parents 82e918444965
children 6af3ac33eeea
files src/protocols/jabber/jabber.c
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/jabber/jabber.c	Thu Jan 19 07:01:58 2006 +0000
+++ b/src/protocols/jabber/jabber.c	Thu Jan 19 07:06:19 2006 +0000
@@ -1040,6 +1040,7 @@
 		for(l=jb->resources; l; l = l->next) {
 			char *text = NULL;
 			char *res = NULL;
+			const char *state;
 
 			jbr = l->data;
 
@@ -1055,16 +1056,21 @@
 			if(jbr->name)
 				res = g_strdup_printf(" (%s)", jbr->name);
 
+			state = jabber_buddy_state_get_name(jbr->state);
+			if (text != NULL && !gaim_utf8_strcasecmp(state, text)) {
+				g_free(text);
+				text = NULL;
+			}
+
 			g_string_append_printf(ret, "\n<b>%s%s:</b> %s%s%s",
 					_("Status"),
 					res ? res : "",
-					jabber_buddy_state_get_name(jbr->state),
+					state,
 					text ? ": " : "",
 					text ? text : "");
-			if(text)
-				g_free(text);
-			if(res)
-				g_free(res);
+
+			g_free(text);
+			g_free(res);
 		}
 
 		if(!GAIM_BUDDY_IS_ONLINE(b) && jb->error_msg) {