pidgin/pidgin

msn: Hard fail if buddy list is unavailable.
release-2.x.y
2014-11-12, Elliott Sales de Andrade
ee51d84aacbf
msn: Hard fail if buddy list is unavailable.

Previously, this would blindly continue to attempt to connect, and
that's a lot of extra load as in the recent case of the ApplicationId
being disabled on the MSN servers.
--- a/libpurple/protocols/msn/contact.c Sat Nov 08 01:42:55 2014 -0500
+++ b/libpurple/protocols/msn/contact.c Wed Nov 12 02:21:47 2014 -0500
@@ -487,12 +487,6 @@
* this is not handled yet
*/
if ((fault = xmlnode_get_child(node, "Body/Fault"))) {
- if ((faultnode = xmlnode_get_child(fault, "faultstring"))) {
- char *faultstring = xmlnode_get_data(faultnode);
- purple_debug_info("msn", "Retrieving contact list failed: %s\n",
- faultstring);
- g_free(faultstring);
- }
if ((faultnode = xmlnode_get_child(fault, "detail/errorcode"))) {
char *errorcode = xmlnode_get_data(faultnode);
@@ -505,7 +499,15 @@
g_free(errorcode);
}
- msn_get_contact_list(session, MSN_PS_INITIAL, NULL);
+ if ((faultnode = xmlnode_get_child(fault, "faultstring"))) {
+ char *faultstring = xmlnode_get_data(faultnode);
+ purple_debug_info("msn", "Retrieving contact list failed: %s\n",
+ faultstring);
+ msn_session_set_error(session, MSN_ERROR_BAD_BLIST, faultstring);
+ g_free(faultstring);
+ } else {
+ msn_session_set_error(session, MSN_ERROR_BAD_BLIST, NULL);
+ }
return FALSE;
} else {
xmlnode *service;
--- a/libpurple/protocols/msn/session.c Sat Nov 08 01:42:55 2014 -0500
+++ b/libpurple/protocols/msn/session.c Wed Nov 12 02:21:47 2014 -0500
@@ -408,9 +408,9 @@
break;
case MSN_ERROR_BAD_BLIST:
reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
- msg = g_strdup(_("Your MSN buddy list is temporarily "
- "unavailable. Please wait and try "
- "again."));
+ msg = g_strdup_printf(_("Your MSN buddy list is temporarily "
+ "unavailable: %s"),
+ (info == NULL) ? _("Unknorn error") : info);
break;
default:
reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;