diff libpurple/protocols/yahoo/yahoo.c @ 25362:65cfc59858cf

propagate from branch 'im.pidgin.pidgin' (head d5bb29138cbe033bbfd8ec689203d73818765327) to branch 'im.pidgin.pidgin.next.minor' (head 35ee8e40db640867e5b9239030cdc326e7f0a005)
author Gary Kramlich <grim@reaperworld.com>
date Sat, 13 Dec 2008 05:45:27 +0000
parents 94fa7211eb98 9fb7910c1176
children
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo.c	Wed Dec 03 01:58:45 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Sat Dec 13 05:45:27 2008 +0000
@@ -2125,7 +2125,7 @@
 	char *url = NULL;
 	char *fullmsg;
 	PurpleAccount *account = gc->account;
-	PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED;
+	PurpleConnectionError reason = PURPLE_CONNECTION_ERROR_OTHER_ERROR;
 
 	while (l) {
 		struct yahoo_pair *pair = l->data;
@@ -2139,6 +2139,10 @@
 	}
 
 	switch (err) {
+	case 0:
+		msg = g_strdup(_("Unknown error."));
+		reason = PURPLE_CONNECTION_ERROR_NETWORK_ERROR;
+		break;
 	case 3:
 		msg = g_strdup(_("Invalid username."));
 		reason = PURPLE_CONNECTION_ERROR_INVALID_USERNAME;
@@ -2163,9 +2167,11 @@
 			purple_account_set_password(account, NULL);
 
 		msg = g_strdup(_("Incorrect password."));
+		reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED;
 		break;
 	case 14:
 		msg = g_strdup(_("Your account is locked, please log in to the Yahoo! website."));
+		reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED;
 		break;
 	default:
 		msg = g_strdup_printf(_("Unknown error number %d. Logging into the Yahoo! website may fix this."), err);
@@ -2703,6 +2709,7 @@
 			  strncmp(buf, "HTTP/1.1 302", strlen("HTTP/1.1 302")))) {
 		purple_connection_error_reason(gc, PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
 			_("Received unexpected HTTP response from server."));
+		purple_debug_misc("yahoo", "Unexpected HTTP response: %s\n", buf);
 		return;
 	}
 
@@ -2799,7 +2806,7 @@
 
 static void yahoo_login_page_hash_iter(const char *key, const char *val, GString *url)
 {
-	if (!strcmp(key, "passwd"))
+	if (!strcmp(key, "passwd") || !strcmp(key, "login"))
 		return;
 	g_string_append_c(url, '&');
 	g_string_append(url, key);