Mercurial > pidgin.yaz
comparison libpurple/protocols/myspace/myspace.c @ 17908:5c2720824798
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.
author | Jeffrey Connelly <jaconnel@calpoly.edu> |
---|---|
date | Mon, 25 Jun 2007 05:38:56 +0000 |
parents | 8ee3fd09a543 |
children | a014bcce5a5d |
comparison
equal
deleted
inserted
replaced
17907:8ee3fd09a543 | 17908:5c2720824798 |
---|---|
272 | 272 |
273 purple_debug_info("myspace", "logging in %s\n", acct->username); | 273 purple_debug_info("myspace", "logging in %s\n", acct->username); |
274 | 274 |
275 gc = purple_account_get_connection(acct); | 275 gc = purple_account_get_connection(acct); |
276 gc->proto_data = msim_session_new(acct); | 276 gc->proto_data = msim_session_new(acct); |
277 | |
278 if (strlen(acct->password) > MSIM_MAX_PASSWORD_LENGTH) | |
279 { | |
280 gchar *str; | |
281 | |
282 | |
283 /* TODO: Find out why >8 is problematic. The web site lets you have | |
284 * long passwords, but reportedly the official IM client does not | |
285 * allow more than 8 characters to be entered. Just entering the first | |
286 * 8 does not, on first try, appear to work. */ | |
287 str = g_strdup_printf(_("Sorry, passwords over %d characters in length (yours is %d) are " | |
288 "currently not supported by the MySpaceIM plugin."), MSIM_MAX_PASSWORD_LENGTH, | |
289 (int)strlen(acct->password)); | |
290 | |
291 /* Notify an error message also, because this is important! */ | |
292 purple_notify_error(acct, g_strdup(_("MySpaceIM Error")), str, NULL); | |
293 | |
294 purple_connection_error(gc, str); | |
295 | |
296 g_free(str); | |
297 } | |
298 | |
277 | 299 |
278 /* 1. connect to server */ | 300 /* 1. connect to server */ |
279 purple_connection_update_progress(gc, _("Connecting"), | 301 purple_connection_update_progress(gc, _("Connecting"), |
280 0, /* which connection step this is */ | 302 0, /* which connection step this is */ |
281 4); /* total number of steps */ | 303 4); /* total number of steps */ |