# HG changeset patch # User Mark Doliner # Date 1271292902 0 # Node ID 1e9f8f54dff4871649c9ae1903cfc4bcfa745624 # Parent 2e0dffa155dba1769db898240af7b02f8a43527d Support receiving HTML-formatted messages for ICQ. I should have let a summer of code student do this, but curiosity got the best of me. diff -r 2e0dffa155db -r 1e9f8f54dff4 ChangeLog --- a/ChangeLog Thu Apr 15 00:49:01 2010 +0000 +++ b/ChangeLog Thu Apr 15 00:55:02 2010 +0000 @@ -65,6 +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. MSN: * Support for version 9 of the MSN protocol has been removed. This diff -r 2e0dffa155db -r 1e9f8f54dff4 libpurple/protocols/oscar/family_icbm.c --- a/libpurple/protocols/oscar/family_icbm.c Thu Apr 15 00:49:01 2010 +0000 +++ b/libpurple/protocols/oscar/family_icbm.c Thu Apr 15 00:55:02 2010 +0000 @@ -274,6 +274,7 @@ | AIM_IMPARAM_FLAG_MISSED_CALLS_ENABLED | AIM_IMPARAM_FLAG_EVENTS_ALLOWED | AIM_IMPARAM_FLAG_SMS_SUPPORTED + | AIM_IMPARAM_FLAG_SEND_ME_HTML_FOR_ICQ | AIM_IMPARAM_FLAG_OFFLINE_MSGS_ALLOWED; params.maxmsglen = 8000; params.minmsginterval = 0; diff -r 2e0dffa155db -r 1e9f8f54dff4 libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Thu Apr 15 00:49:01 2010 +0000 +++ b/libpurple/protocols/oscar/oscar.c Thu Apr 15 00:55:02 2010 +0000 @@ -2494,8 +2494,15 @@ * * Note: There *may* be some clients which send messages as HTML formatted - * they need to be special-cased somehow. + * + * Update: Newer ICQ clients have started sending IMs as HTML. We can + * distinguish HTML IMs from non-HTML IMs by looking at the features. If + * the features are "0x 01 06" then the message is plain text. If the + * features are "0x 01" then the message is HTML. */ - if (od->icq && oscar_util_valid_name_icq(userinfo->bn)) { + if (od->icq && oscar_util_valid_name_icq(userinfo->bn) + && (args->featureslen != 1 || args->features[0] != 0x01)) + { /* being recevied by ICQ from ICQ - escape HTML so it is displayed as sent */ gchar *tmp2 = g_markup_escape_text(tmp, -1); g_free(tmp); @@ -4731,6 +4738,10 @@ 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); diff -r 2e0dffa155db -r 1e9f8f54dff4 libpurple/protocols/oscar/oscar.h --- a/libpurple/protocols/oscar/oscar.h Thu Apr 15 00:49:01 2010 +0000 +++ b/libpurple/protocols/oscar/oscar.h Thu Apr 15 00:55:02 2010 +0000 @@ -746,6 +746,7 @@ #define AIM_IMPARAM_FLAG_EVENTS_ALLOWED 0x00000008 #define AIM_IMPARAM_FLAG_SMS_SUPPORTED 0x00000010 #define AIM_IMPARAM_FLAG_OFFLINE_MSGS_ALLOWED 0x00000100 +#define AIM_IMPARAM_FLAG_SEND_ME_HTML_FOR_ICQ 0x00000400 /* This is what the server will give you if you don't set them yourself. */ /* This is probably out of date. */