changeset 31849:4c046f6564cd

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.
author Mark Doliner <mark@kingant.net>
date Mon, 09 May 2011 04:42:52 +0000
parents 0d4702446530
children 3e4b6ffbb551
files ChangeLog libpurple/protocols/oscar/oscar.c
diffstat 2 files changed, 8 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- 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:
--- 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";
 }