changeset 10730:e84b1ef01905

[gaim-migrate @ 12331] Patch 2/4 committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 26 Mar 2005 01:18:47 +0000
parents 969f35b31a49
children 783ca1f1ebdb
files src/protocols/irc/msgs.c
diffstat 1 files changed, 10 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/irc/msgs.c	Fri Mar 25 22:54:28 2005 +0000
+++ b/src/protocols/irc/msgs.c	Sat Mar 26 01:18:47 2005 +0000
@@ -56,11 +56,15 @@
 
 static void irc_chat_remove_buddy(GaimConversation *convo, char *data[2])
 {
-	char *message = g_strdup_printf("quit: %s", data[1]);
+	char *escaped, *message;
+
+	escaped = g_markup_escape_text(data[1], -1);
+	message = g_strdup_printf("quit: %s", escaped);
 
 	if (gaim_conv_chat_find_user(GAIM_CONV_CHAT(convo), data[0]))
 		gaim_conv_chat_remove_user(GAIM_CONV_CHAT(convo), data[0], message);
 
+	g_free(escaped);
 	g_free(message);
 }
 
@@ -818,7 +822,7 @@
 {
 	GaimConnection *gc = gaim_account_get_connection(irc->account);
 	GaimConversation *convo;
-	char *nick, *msg;
+	char *nick, *msg, *escaped;
 
 	if (!args || !args[0] || !gc)
 		return;
@@ -829,17 +833,19 @@
 		return;
 	}
 
+	escaped = (args[1] && *args[1]) ? g_markup_escape_text(args[1], -1) : NULL;
 	nick = irc_mask_nick(from);
 	if (!gaim_utf8_strcasecmp(nick, gaim_connection_get_display_name(gc))) {
 		msg = g_strdup_printf(_("You have parted the channel%s%s"),
                                       (args[1] && *args[1]) ? ": " : "",
-				      (args[1] && *args[1]) ? args[1] : "");
+									  (escaped && *escaped) ? escaped : "");
 		gaim_conv_chat_write(GAIM_CONV_CHAT(convo), args[0], msg, GAIM_MESSAGE_SYSTEM, time(NULL));
 		g_free(msg);
 		serv_got_chat_left(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(convo)));
 	} else {
-		gaim_conv_chat_remove_user(GAIM_CONV_CHAT(convo), nick, args[1]);
+		gaim_conv_chat_remove_user(GAIM_CONV_CHAT(convo), nick, escaped);
 	}
+	g_free(escaped);
 	g_free(nick);
 }