diff libpurple/protocols/msn/notification.c @ 25460: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 a214dc3807f8
children 9398f0f2cdc6
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);
 }