# HG changeset patch # User Ethan Blanton # Date 1122686966 0 # Node ID 1f0844561c7ea9863fc690ac4c46e52896785381 # Parent ebb02ea3c7896f060b58424c9e76dfee27ccea0c [gaim-migrate @ 13274] Change assumed capabilities for offline ICQ users to fix encoding troubles. Thanks to Ilya Konstantinov, SF Bug #1179452. committer: Tailor Script diff -r ebb02ea3c789 -r 1f0844561c7e ChangeLog --- a/ChangeLog Sat Jul 30 00:23:21 2005 +0000 +++ b/ChangeLog Sat Jul 30 01:29:26 2005 +0000 @@ -52,6 +52,7 @@ * Many problems related to having an IM conversation and a chat open with the same name (Andrew Hart) * Improved buddy list searching with CTRL+F + * ICQ encoding fix for offline buddies (Ilya Konstantinov) Preference changes: * Removed "Dim idle buddies" buddy list preference, default to "Yes." diff -r ebb02ea3c789 -r 1f0844561c7e src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Sat Jul 30 00:23:21 2005 +0000 +++ b/src/protocols/oscar/oscar.c Sat Jul 30 01:29:26 2005 +0000 @@ -76,6 +76,7 @@ static fu8_t features_aim[] = {0x01, 0x01, 0x01, 0x02}; static fu8_t features_icq[] = {0x01, 0x06}; +static fu8_t features_icq_offline[] = {0x01}; static fu8_t ck[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; typedef struct _OscarData OscarData; @@ -5624,8 +5625,21 @@ args.flags = AIM_IMFLAGS_ACK | AIM_IMFLAGS_CUSTOMFEATURES; if (od->icq) { - args.features = features_icq; - args.featureslen = sizeof(features_icq); + /* We have to present different "features" (whose meaning + is unclear and are merely a result of protocol inspection) + to offline ICQ buddies. Otherwise, the official + ICQ client doesn't treat those messages as being "ANSI- + encoded" (and instead, assumes them to be UTF-8). + For more details, see SF issue 1179452. + */ + GaimBuddy *buddy = gaim_find_buddy(gc->account, name); + if (buddy && buddy->present != 0) { + args.features = features_icq; + args.featureslen = sizeof(features_icq); + } else { + args.features = features_icq_offline; + args.featureslen = sizeof(features_icq_offline); + } args.flags |= AIM_IMFLAGS_OFFLINE; } else { args.features = features_aim;