changeset 30568:0b2403172dee

merge of '215ef5d9abdd1383add930273847c6f71152f12e' and '7786ed6f7931081801ff5a3435820ed6f90ba2ca'
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 31 May 2010 06:58:02 +0000
parents b7d6de577921 (current diff) 137d464440f7 (diff)
children 28e74daf53fb
files
diffstat 1 files changed, 11 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/notification.c	Mon May 31 03:20:12 2010 +0000
+++ b/libpurple/protocols/msn/notification.c	Mon May 31 06:58:02 2010 +0000
@@ -1572,7 +1572,7 @@
 	PurpleAccount *account;
 	MsnUser *user;
 	const char *passport;
-	char *psm_str, *str;
+	char *str;
 
 	session = cmdproc->session;
 	account = session->account;
@@ -1580,7 +1580,7 @@
 	passport = cmd->params[0];
 	user = msn_userlist_find_user(session->userlist, passport);
 	if (user == NULL) {
-		char *str = g_strndup(payload, len);
+		str = g_strndup(payload, len);
 		purple_debug_info("msn", "unknown user %s, payload is %s\n",
 			passport, str);
 		g_free(str);
@@ -1595,12 +1595,13 @@
 		user->extinfo->media_album = NULL;
 		user->extinfo->media_artist = NULL;
 		user->extinfo->media_title = NULL;
+		user->extinfo->media_type = CURRENT_MEDIA_UNKNOWN;
 	}
 
 	if (len != 0) {
-		psm_str = msn_get_psm(cmd->payload,len);
-		msn_user_set_statusline(user, psm_str);
-		g_free(psm_str);
+		str = msn_get_psm(cmd->payload,len);
+		msn_user_set_statusline(user, str);
+		g_free(str);
 
 		str = msn_get_currentmedia(cmd->payload, len);
 		parse_currentmedia(user, str);
@@ -1609,6 +1610,11 @@
 		msn_user_set_statusline(user, NULL);
 	}
 
+	if (user->extinfo && user->extinfo->media_type == CURRENT_MEDIA_UNKNOWN) {
+		g_free(user->extinfo);
+		user->extinfo = NULL;
+	}
+
 	msn_user_update(user);
 }