pidgin: 32b49e83: Set a NULL statusline and CurrentMedia i...

qulogic at pidgin.im qulogic at pidgin.im
Sun Feb 15 18:15:50 EST 2009


-----------------------------------------------------------------
Revision: 32b49e8309b1bb3241307b1981798feebf48fdf8
Ancestor: b4500d2dcd6e7e5a4a5804ccfb0d2db2d84acc7f
Author: qulogic at pidgin.im
Date: 2009-02-15T22:52:47
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/32b49e8309b1bb3241307b1981798feebf48fdf8

Modified files:
        libpurple/protocols/msn/notification.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/notification.c	022b7c1835b44ee1410c55032818e773a3b1a2c8
+++ libpurple/protocols/msn/notification.c	639afb195018bf76bd684d56c17bdcc178c922bb
@@ -1619,19 +1619,25 @@ ubx_cmd_post(MsnCmdProc *cmdproc, MsnCom
 		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);
 }


More information about the Commits mailing list