changeset 28625:ca0d55a8943f

Dimmuxx noticed that retrieving OIM didn't work for him until he signs off and back on, and that the faltcode is such: <soap:Fault> <faultcode>AuthenticationFailed</faultcode> <faultstring>Authentication Failed</faultstring> <detail> <TweenerChallenge xmlns="http://www.hotmail.msn.com/ws/2004/09/oim/rsi">Passport1.4 blah blah blah blah</TweenerChallenge> </detail> </soap:Fault> and so he says, "I'm pretty sure just switching badcontexttoken or adding another else if will fix it :P" As usual, ZERO amount of verification was done. But don't we have a lot of users who offered to help except they can't code? Hint hint hint.
author Ka-Hing Cheung <khc@hxbc.us>
date Tue, 15 Sep 2009 01:04:11 +0000
parents 3d5f1cde625a
children ddbb3a85d9d8
files libpurple/protocols/msn/oim.c
diffstat 1 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/oim.c	Sat Sep 12 01:01:56 2009 +0000
+++ b/libpurple/protocols/msn/oim.c	Tue Sep 15 01:04:11 2009 +0000
@@ -172,8 +172,18 @@
 
 	if (faultcode) {
 		gchar *faultcode_str = xmlnode_get_data(faultcode);
+		gboolean need_token_update = FALSE;
 
-		if (faultcode_str && g_str_equal(faultcode_str, "q0:BadContextToken")) {
+		if (faultcode_str) {
+			if (g_str_equal(faultcode_str, "q0:BadContextToken") ||
+				g_str_equal(faultcode_str, "AuthenticationFailed"))
+				need_token_update = TRUE;
+			else if (g_str_equal(faultcode_str, "q0:AuthenticationFailed") &&
+				xmlnode_get_child(fault, "detail/RequiredAuthPolicy") != NULL)
+				need_token_update = TRUE;
+		}
+
+		if (need_token_update) {
 			purple_debug_warning("msn", "OIM Request Error, Updating token now.\n");
 			msn_nexus_update_token(data->oim->session->nexus,
 				data->send ? MSN_AUTH_LIVE_SECURE : MSN_AUTH_MESSENGER_WEB,
@@ -181,16 +191,8 @@
 			g_free(faultcode_str);
 			return;
 
-		} else if (faultcode_str && g_str_equal(faultcode_str, "q0:AuthenticationFailed")) {
-			if (xmlnode_get_child(fault, "detail/RequiredAuthPolicy") != NULL) {
-				purple_debug_warning("msn", "OIM Request Error, Updating token now.\n");
-				msn_nexus_update_token(data->oim->session->nexus,
-					data->send ? MSN_AUTH_LIVE_SECURE : MSN_AUTH_MESSENGER_WEB,
-					(GSourceFunc)msn_oim_request_helper, data);
-				g_free(faultcode_str);
-				return;
-			}
 		}
+
 		g_free(faultcode_str);
 	}