changeset 28521:546dcce6f780

oscar: According to the online docs, statusCode 607 is rate limit (confirmed by my "tests" and Adium#13368c5. 401 is supposedly "Authorization required", but I've left in that anyway. http://dev.aol.com/aim/web/serverapi_reference#startOSCARSession
author Paul Aurich <paul@darkrain42.org>
date Fri, 06 Nov 2009 18:12:01 +0000
parents 682b441d4944
children 9832ae3b94fd 5f77d173f8da
files libpurple/protocols/oscar/clientlogin.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/clientlogin.c	Fri Nov 06 09:57:49 2009 +0000
+++ b/libpurple/protocols/oscar/clientlogin.c	Fri Nov 06 18:12:01 2009 +0000
@@ -109,6 +109,7 @@
 	xmlnode *host_node = NULL, *port_node = NULL, *cookie_node = NULL, *tls_node = NULL;
 	gboolean use_tls;
 	char *tmp;
+	guint code;
 
 	use_tls = purple_account_get_bool(purple_connection_get_account(gc), "use_ssl", OSCAR_DEFAULT_USE_SSL);
 
@@ -153,12 +154,13 @@
 	}
 
 	/* Make sure the status code was 200 */
-	if (strcmp(tmp, "200") != 0)
+	code = atoi(tmp);
+	if (code != 200)
 	{
 		purple_debug_error("oscar", "startOSCARSession response statusCode "
 				"was %s: %s\n", tmp, response);
 
-		if (strcmp(tmp, "401") == 0)
+		if (code == 401 || code == 607)
 			purple_connection_error_reason(gc,
 					PURPLE_CONNECTION_ERROR_OTHER_ERROR,
 					_("You have been connecting and disconnecting too "