changeset 10774:d83f745c997b

[gaim-migrate @ 12383] Some escaping stuff, all over the place. Various escaping fixes in the IRC prpl. The core and plugins only need to escape text if it's going to be shown in a gtkimhtml or equivalent - such as writing to a conversation window, or gaim_notify_{formatted,userinfo} The primary and secondary text for all notify and request API functions do NOT need to be escaped by the core or plugins, because whether html-like markup is required for these is UI dependent. Now we always escape these in the Gtk UI request & notify ops. Should I backport any of the above to oldstatus? I also removed gaim_chat_get_display_name() - it was almost a duplicate of gaim_chat_get_name(), and it leaked. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 02 Apr 2005 17:18:43 +0000
parents 888d4c328be5
children d47e82ac9918
files plugins/ChangeLog.API src/account.c src/blist.c src/blist.h src/ft.c src/gtkdialogs.c src/gtknotify.c src/gtkpounce.c src/gtkrequest.c src/protocols/irc/msgs.c src/protocols/jabber/message.c src/protocols/msn/userlist.c src/protocols/silc/ops.c src/server.c
diffstat 14 files changed, 100 insertions(+), 122 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/ChangeLog.API	Sat Apr 02 16:38:33 2005 +0000
+++ b/plugins/ChangeLog.API	Sat Apr 02 17:18:43 2005 +0000
@@ -37,6 +37,7 @@
 	* Removed: serv_close
 	* Removed: serv_finish_login
 	* Changed: keep_alive in GaimConnection is renamed to keepalive
+	* Removed: gaim_chat_get_display_name
 
 	Signals:
 	* Changed: "received-im-msg and "received-chat-msg" to match, both
--- a/src/account.c	Sat Apr 02 16:38:33 2005 +0000
+++ b/src/account.c	Sat Apr 02 17:18:43 2005 +0000
@@ -775,22 +775,19 @@
 request_password(GaimAccount *account)
 {
 	gchar *primary;
-	gchar *escaped;
 	const gchar *username;
 
 	/* Close any previous password request windows */
 	gaim_request_close_with_handle(account);
 
 	username = gaim_account_get_username(account);
-	escaped = g_markup_escape_text(username, strlen(username));
-	primary = g_strdup_printf(_("Enter password for %s (%s)"), escaped,
+	primary = g_strdup_printf(_("Enter password for %s (%s)"), username,
 								  gaim_account_get_protocol_name(account));
 	gaim_request_input(account, _("Enter Password"), primary, NULL, NULL,
 					   FALSE, TRUE, NULL,
 					   _("OK"), G_CALLBACK(request_password_ok_cb),
 					   _("Cancel"), NULL, account);
 	g_free(primary);
-	g_free(escaped);
 }
 
 void
--- a/src/blist.c	Sat Apr 02 16:38:33 2005 +0000
+++ b/src/blist.c	Sat Apr 02 17:18:43 2005 +0000
@@ -1019,34 +1019,6 @@
 	return chat;
 }
 
-char *gaim_chat_get_display_name(GaimChat *chat)
-{
-	char *name;
-
-	g_return_val_if_fail(chat != NULL, FALSE);
-
-	if (chat->alias != NULL) {
-		 name = g_strdup(chat->alias);
-	} else {
-		 GList *parts;
-		 GaimPlugin *prpl;
-		 GaimPluginProtocolInfo *prpl_info;
-		 struct proto_chat_entry *pce;
-
-		 prpl = gaim_find_prpl(gaim_account_get_protocol_id(chat->account));
-		 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl);
-
-		 parts = prpl_info->chat_info(chat->account->gc);
-
-		 pce = parts->data;
-		 name = g_markup_escape_text(g_hash_table_lookup(chat->components,
-														 pce->identifier), -1);
-		 g_list_free(parts);
-	}
-
-	return name;
-}
-
 GaimBuddy *gaim_buddy_new(GaimAccount *account, const char *screenname, const char *alias)
 {
 	GaimBlistUiOps *ops = gaimbuddylist->ui_ops;
--- a/src/blist.h	Sat Apr 02 16:38:33 2005 +0000
+++ b/src/blist.h	Sat Apr 02 17:18:43 2005 +0000
@@ -318,14 +318,6 @@
 GaimChat *gaim_chat_new(GaimAccount *account, const char *alias, GHashTable *components);
 
 /**
- * Gets the alias of the chat, or the chat name if the alias does not exist
- *
- * @param chat    The chat
- * @return        The display name of the chat
- */
-char *gaim_chat_get_display_name(GaimChat *chat);
-
-/**
  * Adds a new chat to the buddy list.
  *
  * The chat will be inserted right after node or appended to the end
--- a/src/ft.c	Sat Apr 02 16:38:33 2005 +0000
+++ b/src/ft.c	Sat Apr 02 17:18:43 2005 +0000
@@ -117,8 +117,8 @@
 gaim_xfer_conversation_write(GaimXfer *xfer, char *message, gboolean is_error)
 {
 	GaimConversation *conv = NULL;
-	GString *gs_message = NULL;
 	GaimMessageFlags flags = GAIM_MESSAGE_SYSTEM;
+	char *escaped;
 
 	g_return_if_fail(xfer != NULL);
 	g_return_if_fail(message != NULL);
@@ -129,13 +129,13 @@
 	if (conv == NULL)
 		return;
 
-	gs_message = g_string_new(message);
+	escaped = g_markup_escape_text(message, -1);
 
 	if (is_error)
 		flags = GAIM_MESSAGE_ERROR;
 
-	gaim_conversation_write(conv, NULL, gs_message->str, flags, time(NULL));
-	g_string_free(gs_message, TRUE);
+	gaim_conversation_write(conv, NULL, escaped, flags, time(NULL));
+	g_free(escaped);
 }
 
 static void gaim_xfer_show_file_error(GaimXfer *xfer, const char *filename)
@@ -248,7 +248,7 @@
 static void
 gaim_xfer_ask_recv(GaimXfer *xfer)
 {
-	char *buf, *size_buf, *escaped;
+	char *buf, *size_buf;
 	size_t size;
 
 	/* If we have already accepted the request, ask the destination file
@@ -260,12 +260,10 @@
 		{
 			size = gaim_xfer_get_size(xfer);
 			size_buf = gaim_str_size_to_units(size);
-			escaped = g_markup_escape_text(gaim_xfer_get_filename(xfer), -1);
 			buf = g_strdup_printf(_("%s wants to send you %s (%s)"),
 					      buddy ? gaim_buddy_get_alias(buddy) : xfer->who,
-					      escaped, size_buf);
+					      gaim_xfer_get_filename(xfer), size_buf);
 			g_free(size_buf);
-			g_free(escaped);
 		}
 		else
 		{
@@ -931,7 +929,7 @@
 gaim_xfer_cancel_local(GaimXfer *xfer)
 {
 	GaimXferUiOps *ui_ops;
-	char *msg = NULL, *escaped;
+	char *msg = NULL;
 
 	g_return_if_fail(xfer != NULL);
 
@@ -939,10 +937,8 @@
 
 	if (gaim_xfer_get_filename(xfer) != NULL)
 	{
-		escaped = g_markup_escape_text(gaim_xfer_get_filename(xfer), -1);
 		msg = g_strdup_printf(_("You canceled the transfer of %s"),
-							  escaped);
-		g_free(escaped);
+							  gaim_xfer_get_filename(xfer));
 	}
 	else
 	{
@@ -989,7 +985,7 @@
 gaim_xfer_cancel_remote(GaimXfer *xfer)
 {
 	GaimXferUiOps *ui_ops;
-	gchar *msg, *escaped;
+	gchar *msg;
 	GaimAccount *account;
 	GaimBuddy *buddy;
 
@@ -1003,10 +999,8 @@
 
 	if (gaim_xfer_get_filename(xfer) != NULL)
 	{
-		escaped = g_markup_escape_text(gaim_xfer_get_filename(xfer), -1);
 		msg = g_strdup_printf(_("%s canceled the transfer of %s"),
-				buddy ? gaim_buddy_get_alias(buddy) : xfer->who, escaped);
-		g_free(escaped);
+				buddy ? gaim_buddy_get_alias(buddy) : xfer->who, gaim_xfer_get_filename(xfer));
 	}
 	else
 	{
--- a/src/gtkdialogs.c	Sat Apr 02 16:38:33 2005 +0000
+++ b/src/gtkdialogs.c	Sat Apr 02 17:18:43 2005 +0000
@@ -986,7 +986,7 @@
 void
 gaim_gtkdialogs_remove_chat(GaimChat *chat)
 {
-	gchar *name = gaim_chat_get_display_name(chat);
+	const gchar *name = gaim_chat_get_name(chat);
 	gchar *text = g_strdup_printf(_("You are about to remove the chat %s from your buddy list.  Do you want to continue?"), name);
 
 	g_return_if_fail(chat != NULL);
@@ -995,6 +995,5 @@
 						_("Remove Chat"), G_CALLBACK(gaim_gtkdialogs_remove_chat_cb),
 						_("Cancel"), NULL);
 
-	g_free(name);
 	g_free(text);
 }
--- a/src/gtknotify.c	Sat Apr 02 16:38:33 2005 +0000
+++ b/src/gtknotify.c	Sat Apr 02 17:18:43 2005 +0000
@@ -128,6 +128,7 @@
 	GtkWidget *img = NULL;
 	char label_text[2048];
 	const char *icon_name = NULL;
+	char *primary_esc, *secondary_esc;
 
 	switch (type)
 	{
@@ -175,9 +176,13 @@
 	if (img != NULL)
 		gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
 
+	primary_esc = g_markup_escape_text(primary, -1);
+	secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL;
 	g_snprintf(label_text, sizeof(label_text),
 			   "<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s",
-			   primary, (secondary ? secondary : ""));
+			   primary_esc, (secondary ? secondary_esc : ""));
+	g_free(primary_esc);
+	g_free(secondary_esc);
 
 	label = gtk_label_new(NULL);
 
@@ -350,7 +355,7 @@
 	GtkWidget *frame;
 	int options = 0;
 	char label_text[2048];
-	char *linked_text;
+	char *linked_text, *primary_esc, *secondary_esc;
 
 	window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
 	gtk_window_set_title(GTK_WINDOW(window), title);
@@ -366,11 +371,15 @@
 	gtk_widget_show(vbox);
 
 	/* Setup the descriptive label */
+	primary_esc = g_markup_escape_text(primary, -1);
+	secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL;
 	g_snprintf(label_text, sizeof(label_text),
 			   "<span weight=\"bold\" size=\"larger\">%s</span>%s%s",
-			   primary,
+			   primary_esc,
 			   (secondary ? "\n" : ""),
-			   (secondary ? secondary : ""));
+			   (secondary ? secondary_esc : ""));
+	g_free(primary_esc);
+	g_free(secondary_esc);
 
 	label = gtk_label_new(NULL);
 
@@ -438,6 +447,7 @@
 	GtkTreeIter iter;
 	int i;
 	char *label_text;
+	char *primary_esc, *secondary_esc;
 
 	data = g_malloc(sizeof(GaimNotifySearchResultsData));
 
@@ -456,11 +466,15 @@
 	gtk_widget_show(vbox);
 
 	/* Setup the descriptive label */
+	primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL;
+	secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL;
 	label_text = g_strdup_printf(
 			"<span weight=\"bold\" size=\"larger\">%s</span>%s%s",
-			(primary ? primary : ""),
+			(primary ? primary_esc : ""),
 			(primary && secondary ? "\n" : ""),
-			(secondary ? secondary : ""));
+			(secondary ? secondary_esc : ""));
+	g_free(primary_esc);
+	g_free(secondary_esc);
 	label = gtk_label_new(NULL);
 	gtk_label_set_markup(GTK_LABEL(label), label_text);
 	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
@@ -528,11 +542,13 @@
 
 	for (i = 0; results[i] != NULL; i++)
 	{
+		char *escaped = g_markup_escape_text(results[i], -1);
 		gtk_list_store_append(model, &iter);
 		gtk_list_store_set(model, &iter,
 						   COLUMN_ICON, scaled,
-						   COLUMN_SCREENNAME, results[i],
+						   COLUMN_SCREENNAME, escaped,
 						   -1);
+		g_free(escaped);
 	}
 
 	data->account = gc->account;
--- a/src/gtkpounce.c	Sat Apr 02 16:38:33 2005 +0000
+++ b/src/gtkpounce.c	Sat Apr 02 17:18:43 2005 +0000
@@ -954,9 +954,6 @@
 	{
 		char tmp[1024];
 		const char *name_shown;
-		char *escaped;
-
-		escaped = g_markup_escape_text(alias, -1);
 
 		/*
 		 * Here we place the protocol name in the pounce dialog to lessen
@@ -980,9 +977,7 @@
 				   (events & GAIM_POUNCE_AWAY) ?
 				   _("%s has gone away. (%s)") :
 				   _("Unknown pounce event. Please report this!"),
-				   escaped, gaim_account_get_protocol_name(account));
-
-		g_free(escaped);
+				   alias, gaim_account_get_protocol_name(account));
 
 		/*
 		 * Ok here is where I change the second argument, title, from
--- a/src/gtkrequest.c	Sat Apr 02 16:38:33 2005 +0000
+++ b/src/gtkrequest.c	Sat Apr 02 17:18:43 2005 +0000
@@ -286,6 +286,7 @@
 	GtkWidget *img;
 	GtkWidget *toolbar;
 	char *label_text;
+	char *primary_esc, *secondary_esc;
 
 	data            = g_new0(GaimGtkRequestData, 1);
 	data->type      = GAIM_REQUEST_INPUT;
@@ -332,11 +333,15 @@
 	gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
 
 	/* Descriptive label */
+	primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL;
+	secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL;
 	label_text = g_strdup_printf((primary ? "<span weight=\"bold\" size=\"larger\">"
 								 "%s</span>%s%s" : "%s%s%s"),
-								 (primary ? primary : ""),
+								 (primary ? primary_esc : ""),
 								 ((primary && secondary) ? "\n\n" : ""),
-								 (secondary ? secondary : ""));
+								 (secondary ? secondary_esc : ""));
+	g_free(primary_esc);
+	g_free(secondary_esc);
 
 	label = gtk_label_new(NULL);
 
@@ -435,6 +440,7 @@
 	GtkWidget *radio = NULL;
 	char *label_text;
 	char *radio_text;
+	char *primary_esc, *secondary_esc;
 
 	data            = g_new0(GaimGtkRequestData, 1);
 	data->type      = GAIM_REQUEST_ACTION;
@@ -483,11 +489,15 @@
 	gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
 
 	/* Descriptive label */
+	primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL;
+	secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL;
 	label_text = g_strdup_printf((primary ? "<span weight=\"bold\" size=\"larger\">"
 				      "%s</span>%s%s" : "%s%s%s"),
-				     (primary ? primary : ""),
+				     (primary ? primary_esc : ""),
 				     ((primary && secondary) ? "\n\n" : ""),
-				     (secondary ? secondary : ""));
+				     (secondary ? secondary_esc : ""));
+	g_free(primary_esc);
+	g_free(secondary_esc);
 
 	label = gtk_label_new(NULL);
 
@@ -530,6 +540,7 @@
 	GtkWidget *img;
 	void **buttons;
 	char *label_text;
+	char *primary_esc, *secondary_esc;
 	int i;
 
 	data            = g_new0(GaimGtkRequestData, 1);
@@ -587,11 +598,15 @@
 	gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
 
 	/* Descriptive label */
+	primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL;
+	secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL;
 	label_text = g_strdup_printf((primary ? "<span weight=\"bold\" size=\"larger\">"
 								 "%s</span>%s%s" : "%s%s%s"),
-								 (primary ? primary : ""),
+								 (primary ? primary_esc : ""),
 								 ((primary && secondary) ? "\n\n" : ""),
- 								 (secondary ? secondary : ""));
+								 (secondary ? secondary_esc : ""));
+	g_free(primary_esc);
+	g_free(secondary_esc);
 
 	label = gtk_label_new(NULL);
 
@@ -1234,6 +1249,7 @@
 	GaimRequestFieldGroup *group;
 	GaimRequestField *field;
 	char *label_text;
+	char *primary_esc, *secondary_esc;
 	int total_fields = 0;
 
 	data            = g_new0(GaimGtkRequestData, 1);
@@ -1281,8 +1297,10 @@
 	sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
 
 	if(primary) {
+		primary_esc = g_markup_escape_text(primary, -1);
 		label_text = g_strdup_printf(
-				"<span weight=\"bold\" size=\"larger\">%s</span>", primary);
+				"<span weight=\"bold\" size=\"larger\">%s</span>", primary_esc);
+		g_free(primary_esc);
 		label = gtk_label_new(NULL);
 
 		gtk_label_set_markup(GTK_LABEL(label), label_text);
@@ -1315,9 +1333,11 @@
 	}
 
 	if (secondary) {
+		secondary_esc = g_markup_escape_text(secondary, -1);
 		label = gtk_label_new(NULL);
 
-		gtk_label_set_markup(GTK_LABEL(label), secondary);
+		gtk_label_set_markup(GTK_LABEL(label), secondary_esc);
+		g_free(secondary_esc);
 		gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
 		gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
 		gtk_box_pack_start(GTK_BOX(vbox2), label, TRUE, TRUE, 0);
--- a/src/protocols/irc/msgs.c	Sat Apr 02 16:38:33 2005 +0000
+++ b/src/protocols/irc/msgs.c	Sat Apr 02 17:18:43 2005 +0000
@@ -76,6 +76,7 @@
 void irc_msg_away(struct irc_conn *irc, const char *name, const char *from, char **args)
 {
 	GaimConnection *gc;
+	char *msg;
 
 	if (!args || !args[1])
 		return;
@@ -87,8 +88,11 @@
 	}
 
 	gc = gaim_account_get_connection(irc->account);
-	if (gc)
-		serv_got_im(gc, args[1], args[2], GAIM_CONV_IM_AUTO_RESP, time(NULL));
+	if (gc) {
+		msg = g_markup_escape_text(args[2], -1);
+		serv_got_im(gc, args[1], msg, GAIM_CONV_IM_AUTO_RESP, time(NULL));
+		g_free(msg);
+	}
 }
 
 void irc_msg_badmode(struct irc_conn *irc, const char *name, const char *from, char **args)
@@ -138,7 +142,7 @@
 void irc_msg_chanmode(struct irc_conn *irc, const char *name, const char *from, char **args)
 {
 	GaimConversation *convo;
-	char *buf;
+	char *buf, *escaped;
 
 	if (!args || !args[1] || !args[2])
 		return;
@@ -147,8 +151,10 @@
 	if (!convo)	/* XXX punt on channels we are not in for now */
 		return;
 
-	buf = g_strdup_printf("mode for %s: %s %s", args[1], args[2], args[3] ? args[3] : "");
+	escaped = (args[3] != NULL) ? g_markup_escape_text(args[3], -1) : NULL;
+	buf = g_strdup_printf("mode for %s: %s %s", args[1], args[2], escaped ? escaped : "");
 	gaim_conv_chat_write(GAIM_CONV_CHAT(convo), "", buf, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL));
+	g_free(escaped);
 	g_free(buf);
 
 	return;
@@ -416,6 +422,7 @@
 void irc_msg_motd(struct irc_conn *irc, const char *name, const char *from, char **args)
 {
 	GaimConnection *gc;
+	char *escaped;
 	if (!strcmp(name, "375")) {
 		gc = gaim_account_get_connection(irc->account);
 		if (gc)
@@ -425,7 +432,9 @@
 	if (!irc->motd)
 		irc->motd = g_string_new("");
 
-	g_string_append_printf(irc->motd, "%s<br>", args[1]);
+	escaped = g_markup_escape_text(args[1], -1);
+	g_string_append_printf(irc->motd, "%s<br>", escaped);
+	g_free(escaped);
 }
 
 void irc_msg_endmotd(struct irc_conn *irc, const char *name, const char *from, char **args)
@@ -470,7 +479,6 @@
 {
 	GaimConnection *gc;
 	GaimConversation *convo;
-	char *nick;
 
 	convo = gaim_find_conversation_with_account(GAIM_CONV_ANY, args[1], irc->account);
 	if (convo) {
@@ -483,9 +491,7 @@
 	} else {
 		if ((gc = gaim_account_get_connection(irc->account)) == NULL)
 			return;
-		nick = g_markup_escape_text(args[1], -1);
-		gaim_notify_error(gc, NULL, _("No such nick or channel"), nick);
-		g_free(nick);
+		gaim_notify_error(gc, NULL, _("No such nick or channel"), args[1]);
 	}
 
 	if (irc->whois.nick && !gaim_utf8_strcasecmp(irc->whois.nick, args[1])) {
@@ -649,7 +655,7 @@
 {
 	GaimConnection *gc = gaim_account_get_connection(irc->account);
 	GaimConversation *convo = gaim_find_conversation_with_account(GAIM_CONV_CHAT, args[0], irc->account);
-	char *nick = irc_mask_nick(from), *buf;
+	char *nick = irc_mask_nick(from), *buf, *reason;
 
 	if (!gc) {
 		g_free(nick);
@@ -662,17 +668,19 @@
 		return;
 	}
 
+	reason = g_markup_escape_text(args[2], -1);
 	if (!gaim_utf8_strcasecmp(gaim_connection_get_display_name(gc), args[1])) {
-		buf = g_strdup_printf(_("You have been kicked by %s: (%s)"), nick, args[2]);
+		buf = g_strdup_printf(_("You have been kicked by %s: (%s)"), nick, reason);
 		gaim_conv_chat_write(GAIM_CONV_CHAT(convo), args[0], buf, GAIM_MESSAGE_SYSTEM, time(NULL));
 		g_free(buf);
 		serv_got_chat_left(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(convo)));
 	} else {
-		buf = g_strdup_printf(_("Kicked by %s (%s)"), nick, args[2]);
+		buf = g_strdup_printf(_("Kicked by %s (%s)"), nick, reason);
 		gaim_conv_chat_remove_user(GAIM_CONV_CHAT(convo), args[1], buf);
 		g_free(buf);
 	}
 
+	g_free(reason);
 	g_free(nick);
 	return;
 }
@@ -683,14 +691,17 @@
 	char *nick = irc_mask_nick(from), *buf;
 
 	if (*args[0] == '#' || *args[0] == '&') {	/* Channel	*/
+		char *escaped;
 		convo = gaim_find_conversation_with_account(GAIM_CONV_CHAT, args[0], irc->account);
 		if (!convo) {
 			gaim_debug(GAIM_DEBUG_ERROR, "irc", "MODE received for %s, which we are not in\n", args[0]);
 			g_free(nick);
 			return;
 		}
-		buf = g_strdup_printf(_("mode (%s %s) by %s"), args[1], args[2] ? args[2] : "", nick);
+		escaped = (args[2] != NULL) ? g_markup_escape_text(args[2], -1) : NULL;
+		buf = g_strdup_printf(_("mode (%s %s) by %s"), args[1], escaped ? escaped : "", nick);
 		gaim_conv_chat_write(GAIM_CONV_CHAT(convo), args[0], buf, GAIM_MESSAGE_SYSTEM|GAIM_MESSAGE_NO_LOG, time(NULL));
+		g_free(escaped);
 		g_free(buf);
 		if(args[2]) {
 			GaimConvChatBuddyFlags newflag, flags;
@@ -807,14 +818,11 @@
 void irc_msg_nochangenick(struct irc_conn *irc, const char *name, const char *from, char **args)
 {
 	GaimConnection *gc = gaim_account_get_connection(irc->account);
-	char *msg;
 
 	if (!args || !args[2] || !gc)
 		return;
 
-	msg = g_strdup_printf(_("Could not change nick"));
-	gaim_notify_error(gc, _("Cannot change nick"), msg, args[2]);
-	g_free(msg);
+	gaim_notify_error(gc, _("Cannot change nick"), _("Could not change nick"), args[2]);
 }
 
 void irc_msg_part(struct irc_conn *irc, const char *name, const char *from, char **args)
@@ -995,7 +1003,7 @@
 void irc_msg_wallops(struct irc_conn *irc, const char *name, const char *from, char **args)
 {
 	GaimConnection *gc = gaim_account_get_connection(irc->account);
-	char *nick, *msg, *wallop;
+	char *nick, *msg;
 
 	if (!args || !args[0] || !gc)
 		return;
@@ -1003,10 +1011,8 @@
 	nick = irc_mask_nick(from);
 	msg = g_strdup_printf (_("Wallops from %s"), nick);
 	g_free(nick);
-	wallop = g_markup_escape_text(args[0], strlen(args[0]));
-	gaim_notify_info(gc, NULL, msg, wallop);
+	gaim_notify_info(gc, NULL, msg, args[0]);
 	g_free(msg);
-	g_free(wallop);
 }
 
 void irc_msg_ignore(struct irc_conn *irc, const char *name, const char *from, char **args)
--- a/src/protocols/jabber/message.c	Sat Apr 02 16:38:33 2005 +0000
+++ b/src/protocols/jabber/message.c	Sat Apr 02 17:18:43 2005 +0000
@@ -203,7 +203,6 @@
 {
 	GHashTable *components;
 	JabberID *jid = jabber_id_new(jm->to);
-	char *stripped;
 
 	if(!jid)
 		return;
@@ -218,9 +217,7 @@
 			g_strdup(jm->password));
 
 	jabber_id_free(jid);
-	stripped = gaim_markup_strip_html(jm->body);
-	serv_got_chat_invite(jm->js->gc, jm->to, jm->from, stripped, components);
-	g_free(stripped);
+	serv_got_chat_invite(jm->js->gc, jm->to, jm->from, jm->body, components);
 }
 
 static void handle_error(JabberMessage *jm)
--- a/src/protocols/msn/userlist.c	Sat Apr 02 16:38:33 2005 +0000
+++ b/src/protocols/msn/userlist.c	Sat Apr 02 17:18:43 2005 +0000
@@ -73,7 +73,7 @@
 got_new_entry(GaimConnection *gc, const char *passport, const char *friendly)
 {
 	MsnPermitAdd *pa;
-	char *msg, *escaped;
+	char *msg;
 
 	pa      = g_new0(MsnPermitAdd, 1);
 	pa->who = g_strdup(passport);
@@ -81,13 +81,11 @@
 
 	if (friendly != NULL)
 	{
-		escaped = g_markup_escape_text(friendly, -1);
 		msg = g_strdup_printf(
 				   _("The user %s (%s) wants to add %s to his or her "
 					 "buddy list."),
-				   passport, escaped,
+				   passport, friendly,
 				   gaim_account_get_username(gc->account));
-		g_free(escaped);
 	}
 	else
 	{
--- a/src/protocols/silc/ops.c	Sat Apr 02 16:38:33 2005 +0000
+++ b/src/protocols/silc/ops.c	Sat Apr 02 17:18:43 2005 +0000
@@ -1294,7 +1294,7 @@
 			SilcServerEntry server_entry;
 			char *server_name;
 			char *server_info;
-			char tmp[256], *msg;
+			char tmp[256];
 
 			if (!success) {
 				gaim_notify_error(gc, _("Server Information"),
@@ -1310,9 +1310,7 @@
 			if (server_name && server_info) {
 				g_snprintf(tmp, sizeof(tmp), "Server: %s\n%s",
 					   server_name, server_info);
-				msg = g_markup_escape_text(tmp, strlen(tmp));
-				gaim_notify_info(gc, NULL, _("Server Information"), msg);
-				g_free(msg);
+				gaim_notify_info(gc, NULL, _("Server Information"), tmp);
 			}
 		}
 		break;
--- a/src/server.c	Sat Apr 02 16:38:33 2005 +0000
+++ b/src/server.c	Sat Apr 02 17:18:43 2005 +0000
@@ -1050,8 +1050,6 @@
 	GaimAccount *account;
 	char buf2[BUF_LONG];
 	struct chat_invite_data *cid = g_new0(struct chat_invite_data, 1);
-	char *name_escaped = g_markup_escape_text(name, -1);
-	char *who_escaped = g_markup_escape_text(who, -1);
 
 	account = gaim_connection_get_account(gc);
 
@@ -1060,19 +1058,14 @@
 
 	if (message != NULL)
 	{
-		char *message_escaped = g_markup_escape_text(message, -1);
 		g_snprintf(buf2, sizeof(buf2),
-				   _("%s has invited %s to the chat room %s:\n<b>%s</b>"),
-				   who_escaped, gaim_account_get_username(account), name_escaped, message_escaped);
-		g_free(message_escaped);
+				   _("%s has invited %s to the chat room %s:\n%s"),
+				   who, gaim_account_get_username(account), name, message);
 	}
 	else
 		g_snprintf(buf2, sizeof(buf2),
 				   _("%s has invited %s to the chat room %s\n"),
-				   who_escaped, gaim_account_get_username(account), name_escaped);
-
-	g_free(name_escaped);
-	g_free(who_escaped);
+				   who, gaim_account_get_username(account), name);
 
 	cid->gc = gc;
 	cid->components = data;