pidgin: e86a2edf: And allow sending HTML over ICQ, too. O...

markdoliner at pidgin.im markdoliner at pidgin.im
Wed Apr 14 21:05:27 EDT 2010


-----------------------------------------------------------------
Revision: e86a2edf1a808d62825fa1e6109ead33f72982d6
Ancestor: ce1e2f95d94016f0d80e1803674712b9559b70d5
Author: markdoliner at pidgin.im
Date: 2010-04-15T01:01:36
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/e86a2edf1a808d62825fa1e6109ead33f72982d6

Modified files:
        ChangeLog libpurple/protocols/oscar/oscar.c

ChangeLog: 

And allow sending HTML over ICQ, too.  Only lightly tested

-------------- next part --------------
============================================================
--- ChangeLog	57d012f97ff2a914382cf3c742a88143f97d5f6d
+++ ChangeLog	a2baf076a7d1bbcfe9431e276c1c38f53b465a82
@@ -65,7 +65,7 @@ version 2.7.0 (??/??/????):
 	  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
============================================================
--- libpurple/protocols/oscar/oscar.c	2aa81cbdb38122b4efafb7404b8fb82c7c599c1f
+++ libpurple/protocols/oscar/oscar.c	23ee7e0f130aab4bc97ce397ac8c3f727badd1c6
@@ -85,8 +85,7 @@ static guint8 features_aim[] = {0x01, 0x
 		| 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 @@ oscar_login(PurpleAccount *account)
 		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 @@ oscar_send_im(PurpleConnection *gc, cons
 			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 @@ oscar_send_im(PurpleConnection *gc, cons
 
 		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;
 		}


More information about the Commits mailing list