changeset 23452:b268fc2c9121

References #4382, fixes getting offline messages in p15 committer: Ka-Hing Cheung <khc@hxbc.us>
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 12 Jan 2008 23:25:18 +0000
parents aa25bb450139
children bca58b00afab
files libpurple/protocols/msn/nexus.c libpurple/protocols/msn/notification.c libpurple/protocols/msn/oim.c libpurple/protocols/msn/oim.h
diffstat 4 files changed, 49 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/nexus.c	Wed Dec 26 02:33:46 2007 +0000
+++ b/libpurple/protocols/msn/nexus.c	Sat Jan 12 23:25:18 2008 +0000
@@ -37,9 +37,9 @@
 	/* http://msnpiki.msnfanatic.com/index.php/MSNP15:SSO */
 	/* {"Domain", "Policy Ref URI"}, Purpose */
 	{"messengerclear.live.com", NULL},       /* Authentication for messenger. */
-	{"messenger.msn.com", "?id=507"},        /* Messenger website authentication. */
+	{"messenger.msn.com", "?id=507"},        /* Authentication for receiving OIMs. */
 	{"contacts.msn.com", "MBI"},             /* Authentication for the Contact server. */
-	{"messengersecure.live.com", "MBI_SSL"}, /* Used for messenger.live.com */
+	{"messengersecure.live.com", "MBI_SSL"}, /* Authentication for sending OIMs. */
 	{"spaces.live.com", "MBI"},              /* Authentication for the Windows Live Spaces */
 	{"livecontacts.live.com", "MBI"},        /* Live Contacts API, a simplified version of the Contacts SOAP service */
 	{"storage.live.com", "MBI"},             /* Storage REST API */
--- a/libpurple/protocols/msn/notification.c	Wed Dec 26 02:33:46 2007 +0000
+++ b/libpurple/protocols/msn/notification.c	Sat Jan 12 23:25:18 2008 +0000
@@ -326,7 +326,7 @@
 	msn_cmdproc_send(cmdproc, "CVR",
 //					 "0x0409 winnt 5.1 i386 MSG80BETA 8.0.0689 msmsgs %s",
 //					"0x0804 winnt 5.1 i386 MSNMSGR 8.0.0792 msmsgs %s",
-					"0x0409 winnt 5.1 i386 MSNMSGR 8.5.1288.816 msmsgs %s",
+					"0x0409 winnt 5.1 i386 MSNMSGR 8.5.1288 msmsgs %s",
 					 purple_account_get_username(account));
 }
 
--- a/libpurple/protocols/msn/oim.c	Wed Dec 26 02:33:46 2007 +0000
+++ b/libpurple/protocols/msn/oim.c	Sat Jan 12 23:25:18 2008 +0000
@@ -288,11 +288,22 @@
 	MsnOim *oim = rdata->oim;
 	char *msgid = rdata->msg_id;
 	char *soap_body;
+	GHashTable *token;
+	const char *msn_t;
+	const char *msn_p;
 
 	purple_debug_info("MSNP14","Delete single OIM Message {%s}\n",msgid);
 
-	soap_body = g_strdup_printf(MSN_OIM_DEL_TEMPLATE,
-		oim->session->passport_info.t, oim->session->passport_info.p, msgid);
+	token = msn_nexus_get_token(oim->session->nexus, MSN_AUTH_MESSENGER_WEB);
+	g_return_if_fail(token != NULL);
+
+	msn_t = g_hash_table_lookup(token, "t");
+	msn_p = g_hash_table_lookup(token, "p");
+
+	g_return_if_fail(msn_t != NULL);
+	g_return_if_fail(msn_p != NULL);
+
+	soap_body = g_strdup_printf(MSN_OIM_DEL_TEMPLATE, msn_t, msn_p, msgid);
 
 	msn_soap_message_send(oim->session,
 		msn_soap_message_new(MSN_OIM_DEL_SOAP_ACTION,
@@ -535,14 +546,24 @@
 {
 	char *soap_body;
 	MsnOimRecvData *data = g_new0(MsnOimRecvData, 1);
+	GHashTable *token;
+	const char *msn_t;
+	const char *msn_p;
 
 	purple_debug_info("MSNP14","Get single OIM Message\n");
 
+	token = msn_nexus_get_token(oim->session->nexus, MSN_AUTH_MESSENGER_WEB);
+	g_return_if_fail(token != NULL);
+
+	msn_t = g_hash_table_lookup(token, "t");
+	msn_p = g_hash_table_lookup(token, "p");
+	g_return_if_fail(msn_t != NULL);
+	g_return_if_fail(msn_p != NULL);
+
 	data->oim = oim;
 	data->msg_id = msgid;
 
-	soap_body = g_strdup_printf(MSN_OIM_GET_TEMPLATE,
-		oim->session->passport_info.t, oim->session->passport_info.p, msgid);
+	soap_body = g_strdup_printf(MSN_OIM_GET_TEMPLATE, msn_t, msn_p, msgid);
 
 	msn_soap_message_send(oim->session,
 		msn_soap_message_new(MSN_OIM_GET_SOAP_ACTION,
--- a/libpurple/protocols/msn/oim.h	Wed Dec 26 02:33:46 2007 +0000
+++ b/libpurple/protocols/msn/oim.h	Sat Jan 12 23:25:18 2008 +0000
@@ -31,7 +31,10 @@
 #define MSN_OIM_GET_SOAP_ACTION	"http://www.hotmail.msn.com/ws/2004/09/oim/rsi/GetMessage"
 
 #define MSN_OIM_GET_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
-"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
+"<soap:Envelope"\
+	" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
+	" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
+	" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
 	"<soap:Header>"\
 		"<PassportCookie xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
 			"<t>%s</t>"\
@@ -50,11 +53,14 @@
 #define MSN_OIM_DEL_SOAP_ACTION	"http://www.hotmail.msn.com/ws/2004/09/oim/rsi/DeleteMessages"
 
 #define MSN_OIM_DEL_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
-"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
+"<soap:Envelope"\
+	" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
+	" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
+	" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
 	"<soap:Header>"\
 		"<PassportCookie xmlns=\"http://www.hotmail.msn.com/ws/2004/09/oim/rsi\">"\
 			"<t>%s</t>"\
-			" <p>%s</p>"\
+			"<p>%s</p>"\
 		"</PassportCookie>"\
 	"</soap:Header>"\
 	"<soap:Body>"\
@@ -79,9 +85,19 @@
 #define MSN_OIM_SEND_URL	"/OimWS/oim.asmx"
 #define MSN_OIM_SEND_SOAP_ACTION	"http://messenger.live.com/ws/2006/09/oim/Store2"
 #define MSN_OIM_SEND_TEMPLATE "<?xml version=\"1.0\" encoding=\"utf-8\"?>"\
-"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
+"<soap:Envelope"\
+	" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""\
+	" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\""\
+	" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"\
 	"<soap:Header>"\
-		"<From memberName=\"%s\" friendlyName=\"%s\" xml:lang=\"en-US\" proxy=\"MSNMSGR\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\" msnpVer=\"MSNP15\" buildVer=\"8.1.0178\"/>"\
+		"<From"\
+			" memberName=\"%s\""\
+			" friendlyName=\"%s\""\
+			" xml:lang=\"en-US\""\
+			" proxy=\"MSNMSGR\""\
+			" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\""\
+			" msnpVer=\"MSNP15\""\
+			" buildVer=\"8.5.1288\"/>"\
 		"<To memberName=\"%s\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\"/>"\
 		"<Ticket passport=\"%s\" appid=\"%s\" lockkey=\"%s\" xmlns=\"http://messenger.msn.com/ws/2004/09/oim/\"/>"\
 		"<Sequence xmlns=\"http://schemas.xmlsoap.org/ws/2003/03/rm\">"\