pidgin/android/libpurple

*** Plucked rev 6edd4aa8f524b904f6d0c0e4462ebffb9e6f98d1 (markdoliner@pidgin.im):
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.
--- a/ChangeLog Sat Feb 18 23:06:03 2012 +0000
+++ b/ChangeLog Sat Feb 18 23:28:43 2012 +0000
@@ -17,6 +17,8 @@
* Allow signing on with usernames containing periods and
underscores. (#13500)
* Allow adding buddies containing periods and underscores. (#13500)
+ * Don't try to format ICQ usernames entered as email addresses.
+ Gets rid of an "Unable to format username" error at login. (#13883)
MSN:
* Fix possible crashes caused by not validating incoming messages as
--- a/libpurple/protocols/oscar/oscar.c Sat Feb 18 23:06:03 2012 +0000
+++ b/libpurple/protocols/oscar/oscar.c Sat Feb 18 23:28:43 2012 +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;
} else {
gc->flags |= PURPLE_CONNECTION_AUTO_RESP;
@@ -4586,32 +4586,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";
}