summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Connelly <jeff2@soc.pidgin.im>2008-02-06 05:37:32 +0000
committerJeff Connelly <jeff2@soc.pidgin.im>2008-02-06 05:37:32 +0000
commit5f69eab188f728a9e9293d2af35e2604321a3753 (patch)
tree11c3e876dec81e0144e4c4f86a4966476288906a
parent9116ef34807dd1df421af426000019a2eb5098e7 (diff)
downloadpidgin-5f69eab188f728a9e9293d2af35e2604321a3753.tar.gz
In msimprpl, if login fails, and the user's password is greater than
10 characters, note this in the login failure message and offer a URL to shorten it. MySpaceIM apparently limits passwords to 10 characters maximum now. Closes #4369.
-rw-r--r--libpurple/protocols/myspace/myspace.c39
-rw-r--r--libpurple/protocols/myspace/myspace.h6
2 files changed, 21 insertions, 24 deletions
diff --git a/libpurple/protocols/myspace/myspace.c b/libpurple/protocols/myspace/myspace.c
index a8f102601b..67cc762931 100644
--- a/libpurple/protocols/myspace/myspace.c
+++ b/libpurple/protocols/myspace/myspace.c
@@ -290,27 +290,6 @@ msim_login(PurpleAccount *acct)
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 */
@@ -1862,6 +1841,24 @@ msim_error(MsimSession *session, MsimMessage *msg)
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;
diff --git a/libpurple/protocols/myspace/myspace.h b/libpurple/protocols/myspace/myspace.h
index e325f2c27c..d9366c5fc2 100644
--- a/libpurple/protocols/myspace/myspace.h
+++ b/libpurple/protocols/myspace/myspace.h
@@ -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