im.pidgin.pidgin: c68bf74889268c55c15cf101e1d593966b55c2a9

jeff2 at soc.pidgin.im jeff2 at soc.pidgin.im
Wed Feb 6 00:40:43 EST 2008


-----------------------------------------------------------------
Revision: c68bf74889268c55c15cf101e1d593966b55c2a9
Ancestor: 1c0e001dd7982814ff7749e6cb13321d9a096a25
Author: jeff2 at soc.pidgin.im
Date: 2008-02-06T05:37:32
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/c68bf74889268c55c15cf101e1d593966b55c2a9

Modified files:
        libpurple/protocols/myspace/myspace.c
        libpurple/protocols/myspace/myspace.h

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- libpurple/protocols/myspace/myspace.c	b335f1ad3cc7df10679b98f0e76726378cb27f4e
+++ libpurple/protocols/myspace/myspace.c	d42d5500c92bc4f1a9e809e43767a759582dbac4
@@ -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, MsimMes
 				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;
============================================================
--- libpurple/protocols/myspace/myspace.h	f8ea908a2c9689bcf7b63adbc16bd3271b468999
+++ libpurple/protocols/myspace/myspace.h	f4f5954457073686181a5b89dea73d65771a1a98
@@ -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


More information about the Commits mailing list