# HG changeset patch # User Mark Doliner # Date 1304916172 0 # Node ID 4c046f6564cdd784ed48c6d081bcfd7f920d2f8e # Parent 0d4702446530b6d4af70d103e56de081f94de5a4 Change the heuristic we use for setting od->icq. We used to set it to true any time the username contained only digits. Now we set it to try if account->protocol_id is prpl-icq. This means we're now relying on the user to tell us whether their account is AIM or ICQ... and I think that's fine. The reason for this change is that we/AOL apparently allow the user to login to ICQ accounts by entering their email address. This means we're no longer able to look at the username to determine whether it's an AIM name or an ICQ name. This was a problem because we were trying to format the spacing/capitalization in the username if the name was an icq email address, which resulted in an annoying popup error at login. Fixes #13883. It's probably safe for this to go into im.pidgin.pidgin (maybe after the pending release), but I really don't want to keep changing the 2.x.y branch. I think we need to move on to 3.x.y. diff -r 0d4702446530 -r 4c046f6564cd ChangeLog --- a/ChangeLog Mon May 09 04:26:46 2011 +0000 +++ b/ChangeLog Mon May 09 04:42:52 2011 +0000 @@ -3,6 +3,8 @@ version 3.0.0 (??/??/????): AIM and ICQ: * Make buddy list management code more efficient. (Oliver) (#4816) + * Don't try to format ICQ usernames entered as email addresses. + Gets rid of an "Unable to format username" error at login. (#13883) version 2.8.0 (??/??/????): General: diff -r 0d4702446530 -r 4c046f6564cd libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Mon May 09 04:26:46 2011 +0000 +++ b/libpurple/protocols/oscar/oscar.c Mon May 09 04:42:52 2011 +0000 @@ -741,7 +741,7 @@ } gc->flags |= PURPLE_CONNECTION_HTML; - if (oscar_util_valid_name_icq((purple_account_get_username(account)))) { + if (g_str_equal(purple_account_get_protocol_id(account), "prpl-icq")) { od->icq = TRUE; gc->flags |= PURPLE_CONNECTION_SUPPORT_MOODS; } else { @@ -4581,32 +4581,18 @@ const char *oscar_list_icon_icq(PurpleAccount *a, PurpleBuddy *b) { const char *name = b ? purple_buddy_get_name(b) : NULL; - if ((b == NULL) || (name == NULL) || oscar_util_valid_name_sms(name)) - { - if (a == NULL || oscar_util_valid_name_icq(purple_account_get_username(a))) - return "icq"; - else - return "aim"; - } - - if (oscar_util_valid_name_icq(name)) + if (name && !oscar_util_valid_name_sms(name) && oscar_util_valid_name_icq(name)) return "icq"; - return "aim"; + + return "icq"; } const char *oscar_list_icon_aim(PurpleAccount *a, PurpleBuddy *b) { const char *name = b ? purple_buddy_get_name(b) : NULL; - if ((b == NULL) || (name == NULL) || oscar_util_valid_name_sms(name)) - { - if (a != NULL && oscar_util_valid_name_icq(purple_account_get_username(a))) - return "icq"; - else - return "aim"; - } - - if (oscar_util_valid_name_icq(name)) + if (name && !oscar_util_valid_name_sms(name) && oscar_util_valid_name_icq(name)) return "icq"; + return "aim"; }