changeset 25094:11458e8584c2

Set a NULL statusline and CurrentMedia if the UBX returns an empty payload, instead of trying to parse the empty text. If only users wouldn't freak out just because they see the word "error"... Fixes #8348.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 15 Feb 2009 22:52:47 +0000
parents 9487c9b7a01f
children 15fc25014ce2
files libpurple/protocols/msn/notification.c
diffstat 1 files changed, 17 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/notification.c	Sun Feb 15 22:44:25 2009 +0000
+++ b/libpurple/protocols/msn/notification.c	Sun Feb 15 22:52:47 2009 +0000
@@ -1619,19 +1619,25 @@
 		return;
 	}
 
-	psm_str = msn_get_psm(cmd->payload,len);
-	msn_user_set_statusline(user, psm_str);
-	g_free(psm_str);
+	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_currentmedia(cmd->payload, len);
-	if (msn_parse_currentmedia(str, &media))
-		msn_user_set_currentmedia(user, &media);
-	else
+		str = msn_get_currentmedia(cmd->payload, len);
+		if (msn_parse_currentmedia(str, &media))
+			msn_user_set_currentmedia(user, &media);
+		else
+			msn_user_set_currentmedia(user, NULL);
+		g_free(media.title);
+		g_free(media.album);
+		g_free(media.artist);
+		g_free(str);
+
+	} else {
+		msn_user_set_statusline(user, NULL);
 		msn_user_set_currentmedia(user, NULL);
-	g_free(media.title);
-	g_free(media.album);
-	g_free(media.artist);
-	g_free(str);
+	}
 
 	msn_user_update(user);
 }