Mercurial > pidgin.yaz
changeset 22270:762174f38807
merge of 'c68bf74889268c55c15cf101e1d593966b55c2a9'
and 'e39a6e9be3df05b59a878001feb9276b9ceb66a9'
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Wed, 06 Feb 2008 15:50:41 +0000 |
parents | 1f3481447197 (diff) 7f7c89ff5cc7 (current diff) |
children | cc5b2a145652 510ce2239296 f5bcb58bdf56 |
files | libpurple/protocols/myspace/myspace.c |
diffstat | 2 files changed, 21 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/myspace/myspace.c Tue Feb 05 19:12:59 2008 +0000 +++ b/libpurple/protocols/myspace/myspace.c Wed Feb 06 15:50:41 2008 +0000 @@ -291,27 +291,6 @@ gc->proto_data = msim_session_new(acct); gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_NO_URLDESC; -#ifdef MSIM_MAX_PASSWORD_LENGTH - /* Passwords are limited in length. */ - if (strlen(acct->password) > MSIM_MAX_PASSWORD_LENGTH) { - gchar *str; - - str = g_strdup_printf( - _("Sorry, passwords over %d characters in length (yours is " - "%d) are not supported by MySpace."), - MSIM_MAX_PASSWORD_LENGTH, - (int)strlen(acct->password)); - - /* Notify an error message also, because this is important! */ - purple_notify_error(acct, _("MySpaceIM Error"), str, NULL); - - purple_connection_error_reason (gc, - PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED, str); - g_free(str); - return; - } -#endif - /* 1. connect to server */ purple_connection_update_progress(gc, _("Connecting"), 0, /* which connection step this is */ @@ -1863,6 +1842,24 @@ reason = PURPLE_CONNECTION_ERROR_AUTHENTICATION_FAILED; if (!purple_account_get_remember_password(session->account)) purple_account_set_password(session->account, NULL); +#ifdef MSIM_MAX_PASSWORD_LENGTH + if (strlen(session->account->password) > MSIM_MAX_PASSWORD_LENGTH) { + gchar *suggestion; + + suggestion = g_strdup_printf(_("%s Your password is " + "%d characters, greater than the " + "expected maximum length of %d for " + "MySpaceIM. Please shorten your " + "password at http://profileedit.myspace.com/index.cfm?fuseaction=accountSettings.changePassword and try again."), + full_errmsg, (int) + strlen(session->account->password), + MSIM_MAX_PASSWORD_LENGTH); + + /* Replace full_errmsg. */ + g_free(full_errmsg); + full_errmsg = suggestion; + } +#endif break; case MSIM_ERROR_LOGGED_IN_ELSEWHERE: /* Logged in elsewhere */ reason = PURPLE_CONNECTION_ERROR_NAME_IN_USE;
--- a/libpurple/protocols/myspace/myspace.h Tue Feb 05 19:12:59 2008 +0000 +++ b/libpurple/protocols/myspace/myspace.h Wed Feb 06 15:50:41 2008 +0000 @@ -84,9 +84,9 @@ * http://settings.myspace.com/index.cfm?fuseaction=user.changepassword * (though curiously, not on the 'current password' field). */ -/* Not defined; instead have the client reject the password, until libpurple - * supports specifying a length limit on the protocol's password. */ -/* #define MSIM_MAX_PASSWORD_LENGTH 10 */ +/* After login fails, if password is greater than this many characters, + * warn user that it may be too long. */ +#define MSIM_MAX_PASSWORD_LENGTH 10 /* Build version of MySpaceIM to report to servers (1.0.xxx.0) */ #define MSIM_CLIENT_VERSION 697