changeset 11172:1f0844561c7e

[gaim-migrate @ 13274] Change assumed capabilities for offline ICQ users to fix encoding troubles. Thanks to Ilya Konstantinov, SF Bug #1179452. committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Sat, 30 Jul 2005 01:29:26 +0000
parents ebb02ea3c789
children 91ca67258564
files ChangeLog src/protocols/oscar/oscar.c
diffstat 2 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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."
--- 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;