pidgin: 86bb401e: Fix UBX on MSNP18.

qulogic at pidgin.im qulogic at pidgin.im
Fri Feb 3 01:56:12 EST 2012


----------------------------------------------------------------------
Revision: 86bb401efa33f02ca5d28fea216a39a3cf29b5b4
Parent:   b8b574c4d6f6c05105b372191ca5259b4ae0ad41
Author:   qulogic at pidgin.im
Date:     02/02/12 20:26:14
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/86bb401efa33f02ca5d28fea216a39a3cf29b5b4

Changelog: 

Fix UBX on MSNP18.

Changes against parent b8b574c4d6f6c05105b372191ca5259b4ae0ad41

  patched  libpurple/protocols/msn/notification.c

-------------- next part --------------
============================================================
--- libpurple/protocols/msn/notification.c	4534badc27d66694efc1b7b709415892f6a50651
+++ libpurple/protocols/msn/notification.c	3ad20847e13dcda8a8daf987f666166eb50671b1
@@ -1705,13 +1705,19 @@ ubx_cmd_post(MsnCmdProc *cmdproc, MsnCom
 {
 	MsnSession *session;
 	MsnUser *user;
-	const char *passport;
+	char *passport;
+	int network;
 	xmlnode *payloadNode;
 	char *psm_str, *str;
 
 	session = cmdproc->session;
 
-	passport = cmd->params[0];
+	if (session->protocol_ver >= 18) {
+		str = cmd->params[0];
+		msn_parse_user(str, &passport, &network);
+	} else {
+		passport = cmd->params[0];
+	}
 	user = msn_userlist_find_user(session->userlist, passport);
 	if (user == NULL) {
 		char *str = g_strndup(payload, len);
@@ -1721,6 +1727,9 @@ ubx_cmd_post(MsnCmdProc *cmdproc, MsnCom
 		return;
 	}
 
+	if (session->protocol_ver >= 18)
+		g_free(passport);
+
 	/* Free any existing media info for this user */
 	if (user->extinfo) {
 		g_free(user->extinfo->media_album);
@@ -1767,7 +1776,10 @@ ubx_cmd(MsnCmdProc *cmdproc, MsnCommand 
 {
 	purple_debug_misc("msn", "UBX received.\n");
 	cmdproc->last_cmd->payload_cb  = ubx_cmd_post;
-	cmd->payload_len = atoi(cmd->params[2]);
+	if (cmdproc->session->protocol_ver >= 18)
+		cmd->payload_len = atoi(cmd->params[1]);
+	else
+		cmd->payload_len = atoi(cmd->params[2]);
 }
 
 static void


More information about the Commits mailing list