changeset 8908:a9ad52960c1c

[gaim-migrate @ 9678] " This patch will fix misdisplayed friendly names/aliases. For example a msn friendly name containing a < would only display the name up until the <. This probably breaks smileys in friendly names (is that such a bad thing?), but if the user has added any formating (<b>/<i>/<u>/etc) in the alias that will show as text and not as formated.." --Gary Kramlich i prefer the bug he is worried he might have introduced to the bug that he's fixing. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 08 May 2004 23:37:40 +0000
parents 00138e366ef8
children 87e171358001
files src/gtkconv.c
diffstat 1 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkconv.c	Sat May 08 23:34:30 2004 +0000
+++ b/src/gtkconv.c	Sat May 08 23:37:40 2004 +0000
@@ -4635,17 +4635,18 @@
 	}
 	else {
 		char *new_message = g_memdup(message, length);
+		char *who_escaped = g_markup_escape_text(who, strlen(who));
 
 		if (flags & GAIM_MESSAGE_WHISPER) {
 			str = g_malloc(1024);
 
 			/* If we're whispering, it's not an autoresponse. */
 			if (gaim_message_meify(new_message, length)) {
-				g_snprintf(str, 1024, "***%s", who);
+				g_snprintf(str, 1024, "***%s", who_escaped);
 				strcpy(color, "#6C2585");
 			}
 			else {
-				g_snprintf(str, 1024, "*%s*:", who);
+				g_snprintf(str, 1024, "*%s*:", who_escaped);
 				strcpy(color, "#00FF00");
 			}
 		}
@@ -4654,9 +4655,9 @@
 				str = g_malloc(1024);
 
 				if (flags & GAIM_MESSAGE_AUTO_RESP)
-					g_snprintf(str, 1024, "%s ***%s", AUTO_RESPONSE, who);
+					g_snprintf(str, 1024, "%s ***%s", AUTO_RESPONSE, who_escaped);
 				else
-					g_snprintf(str, 1024, "***%s", who);
+					g_snprintf(str, 1024, "***%s", who_escaped);
 
 				if (flags & GAIM_MESSAGE_NICK)
 					strcpy(color, "#AF7F00");
@@ -4666,9 +4667,9 @@
 			else {
 				str = g_malloc(1024);
 				if (flags & GAIM_MESSAGE_AUTO_RESP)
-					g_snprintf(str, 1024, "%s %s", who, AUTO_RESPONSE);
+					g_snprintf(str, 1024, "%s %s", who_escaped, AUTO_RESPONSE);
 				else
-					g_snprintf(str, 1024, "%s:", who);
+					g_snprintf(str, 1024, "%s:", who_escaped);
 				if (flags & GAIM_MESSAGE_NICK)
 					strcpy(color, "#AF7F00");
 				else if (flags & GAIM_MESSAGE_RECV) {
@@ -4689,6 +4690,9 @@
 				else if (flags & GAIM_MESSAGE_SEND)
 					strcpy(color, SEND_COLOR);
 			}
+
+			if(who_escaped)
+				g_free(who_escaped);
 		}
 
 		if (gaim_prefs_get_bool("/gaim/gtk/conversations/show_timestamps"))