changeset 29733:c66e766acb06

And allow sending HTML over ICQ, too. Only lightly tested
author Mark Doliner <mark@kingant.net>
date Thu, 15 Apr 2010 01:01:36 +0000
parents 1e9f8f54dff4
children 54289a753667
files ChangeLog libpurple/protocols/oscar/oscar.c
diffstat 2 files changed, 6 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Apr 15 00:55:02 2010 +0000
+++ b/ChangeLog	Thu Apr 15 01:01:36 2010 +0000
@@ -65,7 +65,7 @@
 	  password on reconnect when "Remember Password" is not checked and
 	  authentication fails due to an incorrect password.  (This is the same
 	  behavior as the legacy authentication method)
-	* Support receiving HTML-formatted messages for ICQ.
+	* Support sending and receiving HTML-formatted messages for ICQ.
 
 	MSN:
 	* Support for version 9 of the MSN protocol has been removed.  This
--- a/libpurple/protocols/oscar/oscar.c	Thu Apr 15 00:55:02 2010 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Thu Apr 15 01:01:36 2010 +0000
@@ -85,8 +85,7 @@
 		| OSCAR_CAPABILITY_XTRAZ;
 
 static guint8 features_aim[] = {0x01, 0x01, 0x01, 0x02};
-static guint8 features_icq[] = {0x01, 0x06};
-static guint8 features_icq_offline[] = {0x01};
+static guint8 features_icq[] = {0x01};
 static guint8 ck[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
 
 struct create_room {
@@ -1578,11 +1577,11 @@
 		return;
 	}
 
+	gc->flags |= PURPLE_CONNECTION_HTML;
 	if (oscar_util_valid_name_icq((purple_account_get_username(account)))) {
 		od->icq = TRUE;
 		gc->flags |= PURPLE_CONNECTION_SUPPORT_MOODS;
 	} else {
-		gc->flags |= PURPLE_CONNECTION_HTML;
 		gc->flags |= PURPLE_CONNECTION_AUTO_RESP;
 	}
 
@@ -4731,24 +4730,8 @@
 			args.flags |= AIM_IMFLAGS_OFFLINE;
 
 		if (od->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.
-			*/
-			/*
-			 * WTF?  Why would we want to send messages as "ANSI" when we
-			 * could use UTF-8?
-			 */
-			if (buddy && PURPLE_BUDDY_IS_ONLINE(buddy)) {
-				args.features = features_icq;
-				args.featureslen = sizeof(features_icq);
-			} else {
-				args.features = features_icq_offline;
-				args.featureslen = sizeof(features_icq_offline);
-			}
+			args.features = features_icq;
+			args.featureslen = sizeof(features_icq);
 		} else {
 			args.features = features_aim;
 			args.featureslen = sizeof(features_aim);
@@ -4798,25 +4781,11 @@
 
 		args.destbn = name;
 
-		/*
-		 * If we're IMing an SMS user or an ICQ user from an ICQ account, then strip HTML.
-		 */
 		if (oscar_util_valid_name_sms(name)) {
-			/* Messaging an SMS (mobile) user */
+			/* Messaging an SMS (mobile) user--strip HTML */
 			tmp2 = purple_markup_strip_html(tmp1);
 			is_html = FALSE;
-		} else if (od->icq) {
-			if (oscar_util_valid_name_icq(name)) {
-				/* From ICQ to ICQ */
-				tmp2 = purple_markup_strip_html(tmp1);
-				is_html = FALSE;
-			} else {
-				/* From ICQ to AIM */
-				tmp2 = g_strdup(tmp1);
-				is_html = TRUE;
-			}
 		} else {
-			/* From AIM to AIM and AIM to ICQ */
 			tmp2 = g_strdup(tmp1);
 			is_html = TRUE;
 		}