diff libpurple/protocols/jabber/jabber.c @ 27487:7a2891487a00

Don't pre-escape jbr->status. Almost every place required it in unescaped form. The places that did want it escaped had to go through a few hoops just to get it right, which are no longer necessary. Also, some other places failed to take into account that it was escaped, causing other display bugs. Fixes #5352.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 12 Jul 2009 22:40:54 +0000
parents 889bf9af9706
children a12574d982a1
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Sun Jul 12 22:25:44 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sun Jul 12 22:40:54 2009 +0000
@@ -1974,19 +1974,18 @@
 		ret = g_strdup(jb->error_msg);
 	} else {
 		PurplePresence *presence = purple_buddy_get_presence(b);
-		PurpleStatus *status =purple_presence_get_active_status(presence);
-		char *stripped;
-
-		if(!(stripped = purple_markup_strip_html(purple_status_get_attr_string(status, "message")))) {
+		PurpleStatus *status = purple_presence_get_active_status(presence);
+		const char *stripped;
+
+		if(!(stripped = purple_status_get_attr_string(status, "message"))) {
 			if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) {
 				PurpleStatus *status = purple_presence_get_status(presence, "tune");
-				stripped = g_strdup(purple_status_get_attr_string(status, PURPLE_TUNE_TITLE));
+				stripped = purple_status_get_attr_string(status, PURPLE_TUNE_TITLE);
 			}
 		}
 
 		if(stripped) {
 			ret = g_markup_escape_text(stripped, -1);
-			g_free(stripped);
 		}
 	}
 
@@ -2003,12 +2002,7 @@
 	const char *state;
 
 	if(jbr->status) {
-		char *tmp;
-		text = purple_strreplace(jbr->status, "\n", "<br />\n");
-		tmp = purple_markup_strip_html(text);
-		g_free(text);
-		text = g_markup_escape_text(tmp, -1);
-		g_free(tmp);
+		text = g_markup_escape_text(jbr->status, -1);
 	}
 
 	if(jbr->name)