# HG changeset patch # User Jeffrey Connelly # Date 1182749936 0 # Node ID 5c2720824798328238c7c3b63425368872daacf4 # Parent 8ee3fd09a543c40edf8824fb667c7cab336acfcb Fail with our own error message if an entered password is greater than 8 characters. Previously, passwords >8 characters caused login to fail, but with the generic error code 260. The reason for this password length limitation has not yet been determined, but it is better to fail with a more descriptive error message than a generic 1. diff -r 8ee3fd09a543 -r 5c2720824798 libpurple/protocols/myspace/myspace.c --- a/libpurple/protocols/myspace/myspace.c Mon Jun 25 05:24:44 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.c Mon Jun 25 05:38:56 2007 +0000 @@ -275,6 +275,28 @@ gc = purple_account_get_connection(acct); gc->proto_data = msim_session_new(acct); + if (strlen(acct->password) > MSIM_MAX_PASSWORD_LENGTH) + { + gchar *str; + + + /* TODO: Find out why >8 is problematic. The web site lets you have + * long passwords, but reportedly the official IM client does not + * allow more than 8 characters to be entered. Just entering the first + * 8 does not, on first try, appear to work. */ + str = g_strdup_printf(_("Sorry, passwords over %d characters in length (yours is %d) are " + "currently not supported by the MySpaceIM plugin."), MSIM_MAX_PASSWORD_LENGTH, + (int)strlen(acct->password)); + + /* Notify an error message also, because this is important! */ + purple_notify_error(acct, g_strdup(_("MySpaceIM Error")), str, NULL); + + purple_connection_error(gc, str); + + g_free(str); + } + + /* 1. connect to server */ purple_connection_update_progress(gc, _("Connecting"), 0, /* which connection step this is */ diff -r 8ee3fd09a543 -r 5c2720824798 libpurple/protocols/myspace/myspace.h --- a/libpurple/protocols/myspace/myspace.h Mon Jun 25 05:24:44 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.h Mon Jun 25 05:38:56 2007 +0000 @@ -75,6 +75,8 @@ /* Constants */ +#define MSIM_MAX_PASSWORD_LENGTH 8 + /* Build version of MySpaceIM to report to servers (1.0.xxx.0) */ #define MSIM_CLIENT_VERSION 673