changeset 10093:9d839c9f6c2d

[gaim-migrate @ 11111] Some more great MSN bugfixes from the patch tracker: Patch: 1045196: Fixed sending messages to MSN Web Messenger users (Damien Ayers) Patches 1045834 & 1044931: Fixed some memory leaks in the MSN plugin (Evan Schoenberg) Patch 1046398: Fixed a potential crash viewing MSN user profiles (Evan Schoenberg) (this also fixed a double-"Has You" bug that was only present in HEAD) Thanks guys! committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Wed, 13 Oct 2004 17:54:11 +0000
parents 1843023b8189
children 2a7780fadbb9
files src/protocols/msn/msn.c src/protocols/msn/object.c src/protocols/msn/switchboard.c src/protocols/msn/utils.c
diffstat 4 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Wed Oct 13 14:40:45 2004 +0000
+++ b/src/protocols/msn/msn.c	Wed Oct 13 17:54:11 2004 +0000
@@ -459,9 +459,12 @@
 							   _("Idle") : gaim_status_get_name(status));
 	}
 
-	g_string_append_printf(s, _("\n<b>%s:</b> %s"), _("Has you"),
-						   (user->list_op & (1 << MSN_LIST_RL)) ?
-						   _("Yes") : _("No"));
+	if (user)
+	{
+		g_string_append_printf(s, _("\n<b>%s:</b> %s"), _("Has you"),
+							   (user->list_op & (1 << MSN_LIST_RL)) ?
+							   _("Yes") : _("No"));
+	}
 
 	return g_string_free(s, FALSE);
 }
@@ -1247,7 +1250,6 @@
 
 	if (b)
 	{
-		MsnUser *user;
 		GaimPresence *presence;
 		char *statustext = msn_tooltip_text(b);
 
@@ -1280,15 +1282,13 @@
 
 		if (statustext)
 		{
-			g_string_append_printf(s, "%s<br>", statustext);
+			char *tmp;
+			tmp = gaim_strreplace((*statustext == '\n' ? statustext + 1 : statustext),
+								  "\n", "<br>");
 			g_free(statustext);
+			g_string_append_printf(s, "%s<br>", tmp);
+			g_free(tmp);
 		}
-
-		user = b->proto_data;
-
-		g_string_append_printf(s, _("<b>%s:</b> %s<br>"), _("Has you"),
-							   (user->list_op & (1 << MSN_LIST_RL)) ?
-							   _("Yes") : _("No"));
 	}
 
 	return g_string_free(s, FALSE);
--- a/src/protocols/msn/object.c	Wed Oct 13 14:40:45 2004 +0000
+++ b/src/protocols/msn/object.c	Wed Oct 13 17:54:11 2004 +0000
@@ -28,6 +28,8 @@
 	{ \
 		tag += strlen(id "=\""); \
 		c = strchr(tag, '"'); \
+		if (obj->field != NULL) \
+			g_free(obj->field); \
 		obj->field = g_strndup(tag, c - tag); \
 	}
 
--- a/src/protocols/msn/switchboard.c	Wed Oct 13 14:40:45 2004 +0000
+++ b/src/protocols/msn/switchboard.c	Wed Oct 13 17:54:11 2004 +0000
@@ -835,6 +835,8 @@
 	}
 
 	msn_switchboard_connect(swboard, host, port);
+
+	g_free(host);
 }
 
 void
--- a/src/protocols/msn/utils.c	Wed Oct 13 14:40:45 2004 +0000
+++ b/src/protocols/msn/utils.c	Wed Oct 13 17:54:11 2004 +0000
@@ -181,6 +181,7 @@
 	msg = g_malloc0(len + 1);
 
 	memset(fontcolor, 0, sizeof(fontcolor));
+	strcat(fontcolor, "0");
 	memset(fonteffect, 0, sizeof(fonteffect));
 
 	for (c = html; *c != '\0';)