changeset 10070:2b6bf836c6b9

[gaim-migrate @ 11046] This should fix Gideon N. Guillen's blank system message problem. I'm getting married tomorrow. Don't expect a lot of patches out of me. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Wed, 29 Sep 2004 15:01:33 +0000
parents 7cbe12859d3a
children af06746954de
files src/protocols/yahoo/yahoo.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c	Wed Sep 29 01:53:36 2004 +0000
+++ b/src/protocols/yahoo/yahoo.c	Wed Sep 29 15:01:33 2004 +0000
@@ -913,7 +913,7 @@
 static void yahoo_process_sysmessage(GaimConnection *gc, struct yahoo_packet *pkt)
 {
 	GSList *l = pkt->hash;
-	char *prim, *me = NULL, *msg = NULL;
+	char *prim, *me = NULL, *msg = NULL, *escmsg = NULL;
 
 	while (l) {
 		struct yahoo_pair *pair = l->data;
@@ -926,13 +926,16 @@
 		l = l->next;
 	}
 
-	if (!msg)
+	if (!msg || !g_utf8_validate(msg, -1, NULL))
 		return;
 
+	escmsg = gaim_escape_html(msg);
+
 	prim = g_strdup_printf(_("Yahoo! system message for %s:"),
 	                       me?me:gaim_connection_get_display_name(gc));
-	gaim_notify_info(NULL, NULL, prim, msg);
+	gaim_notify_info(NULL, NULL, prim, escmsg);
 	g_free(prim);
+	g_free(escmsg);
 }
 
 static void yahoo_buddy_added_us(GaimConnection *gc, struct yahoo_packet *pkt) {