diff libpurple/protocols/yahoo/yahoo.c @ 26048:25e2ab1fff1d

propagate from branch 'im.pidgin.pidgin' (head dd7a36be12180dba9663c2b740553e89711d7644) to branch 'im.pidgin.pidgin.vv' (head 2149cf9a6d4604f6e78ed9a2bdb0bbc3d6041a36)
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sat, 06 Dec 2008 02:23:20 +0000
parents adf153852bcf 9fb7910c1176
children f0c2e27c7ae7
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo.c	Sat Dec 06 02:20:09 2008 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Sat Dec 06 02:23:20 2008 +0000
@@ -2122,7 +2122,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;
@@ -2136,6 +2136,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;
@@ -2160,9 +2164,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);
@@ -2700,6 +2706,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;
 	}
 
@@ -2796,7 +2803,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);