# HG changeset patch # User Ka-Hing Cheung # Date 1252976651 0 # Node ID ca0d55a8943f94f6c9e42cf1538bf6f83ec1e0c8 # Parent 3d5f1cde625ac613487781dd922918b8356c0025 Dimmuxx noticed that retrieving OIM didn't work for him until he signs off and back on, and that the faltcode is such: AuthenticationFailed Authentication Failed Passport1.4 blah blah blah blah 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. diff -r 3d5f1cde625a -r ca0d55a8943f libpurple/protocols/msn/oim.c --- 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); }