changeset 31430:94b3092c904d

Apparently, UBM was updated with more parameters in MSNp16. One is your own email address, but I'm not sure what the 4th parameter is. Anyway, update payload length to use the correct parameter now. Fixes #13022.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 02 Dec 2010 03:59:58 +0000
parents b6514064941d
children 5c2af6c30e52
files ChangeLog libpurple/protocols/msn/notification.c libpurple/protocols/msn/switchboard.c
diffstat 3 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Dec 02 02:56:51 2010 +0000
+++ b/ChangeLog	Thu Dec 02 03:59:58 2010 +0000
@@ -28,6 +28,8 @@
 	  disconnected.
 	* Allow full-size display names, by not escaping (most) non-English
 	  characters. (#8508)
+	* Fix receiving messages from users on Yahoo and other federated
+	  services. (#13022)
 
 version 2.7.7 (11/23/2010):
 	General:
--- a/libpurple/protocols/msn/notification.c	Thu Dec 02 02:56:51 2010 +0000
+++ b/libpurple/protocols/msn/notification.c	Thu Dec 02 03:59:58 2010 +0000
@@ -387,7 +387,10 @@
 	 * command and we are processing it */
 	if (cmd->payload == NULL) {
 		cmdproc->last_cmd->payload_cb = msg_cmd_post;
-		cmd->payload_len = atoi(cmd->params[3]);
+		if (cmdproc->session->protocol_ver >= 16)
+			cmd->payload_len = atoi(cmd->params[5]);
+		else
+			cmd->payload_len = atoi(cmd->params[3]);
 	} else {
 		g_return_if_fail(cmd->payload_cb != NULL);
 
--- a/libpurple/protocols/msn/switchboard.c	Thu Dec 02 02:56:51 2010 +0000
+++ b/libpurple/protocols/msn/switchboard.c	Thu Dec 02 03:59:58 2010 +0000
@@ -743,7 +743,10 @@
 ubm_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
 {
 	purple_debug_misc("msn", "get UBM...\n");
-	cmd->payload_len = atoi(cmd->params[3]);
+	if (cmdproc->session->protocol_ver >= 16)
+		cmd->payload_len = atoi(cmd->params[5]);
+	else
+		cmd->payload_len = atoi(cmd->params[3]);
 	cmdproc->last_cmd->payload_cb = msg_cmd_post;
 }