comparison libpurple/protocols/yahoo/libymsg.c @ 28120:931bb24c28ab

Fix #9660. Reconnect, in case of error 52.
author Sulabh Mahajan <sulabh@soc.pidgin.im>
date Sat, 01 Aug 2009 08:50:19 +0000
parents 63fa5bde1bf6
children c499a1e8ceff
comparison
equal deleted inserted replaced
28119:ed11d1cabbe4 28120:931bb24c28ab
2033 char *msg; 2033 char *msg;
2034 char *url = NULL; 2034 char *url = NULL;
2035 char *fullmsg; 2035 char *fullmsg;
2036 PurpleAccount *account = gc->account; 2036 PurpleAccount *account = gc->account;
2037 PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_OTHER_ERROR; 2037 PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_OTHER_ERROR;
2038 gboolean reconnect = FALSE;
2038 2039
2039 while (l) { 2040 while (l) {
2040 struct yahoo_pair *pair = l->data; 2041 struct yahoo_pair *pair = l->data;
2041 2042
2042 if (pair->key == 66) 2043 if (pair->key == 66)
2080 break; 2081 break;
2081 case 14: 2082 case 14:
2082 msg = g_strdup(_("Your account is locked, please log in to the Yahoo! website.")); 2083 msg = g_strdup(_("Your account is locked, please log in to the Yahoo! website."));
2083 reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; 2084 reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED;
2084 break; 2085 break;
2086 case 52:
2087 /* See #9660. As much as we know, reconnecting shouldn't hurt */
2088 purple_debug_info("yahoo","Got error 52, Set to autoreconnect\n");
2089 reconnect = TRUE;
2090 msg = g_strdup_printf(_("Unknown error number 52. Reconnecting..."));
2091 break;
2085 case 1013: 2092 case 1013:
2086 msg = g_strdup(_("Invalid username")); 2093 msg = g_strdup(_("Invalid username"));
2087 reason = PURPLE_CONNECTION_ERROR_INVALID_USERNAME; 2094 reason = PURPLE_CONNECTION_ERROR_INVALID_USERNAME;
2088 break; 2095 break;
2089 default: 2096 default:
2096 fullmsg = g_strdup(msg); 2103 fullmsg = g_strdup(msg);
2097 2104
2098 purple_connection_error_reason(gc, reason, fullmsg); 2105 purple_connection_error_reason(gc, reason, fullmsg);
2099 g_free(msg); 2106 g_free(msg);
2100 g_free(fullmsg); 2107 g_free(fullmsg);
2108
2109 /* In case of error 52, we reconnect */
2110 if(reconnect)
2111 purple_account_connect(account);
2101 } 2112 }
2102 2113
2103 static void yahoo_process_addbuddy(PurpleConnection *gc, struct yahoo_packet *pkt) 2114 static void yahoo_process_addbuddy(PurpleConnection *gc, struct yahoo_packet *pkt)
2104 { 2115 {
2105 int err = 0; 2116 int err = 0;