adium.1-4: fa7af755: Manually applied the changes to oscar fr...

evands at pidgin.im evands at pidgin.im
Sat May 15 15:46:10 EDT 2010


-----------------------------------------------------------------
Revision: fa7af7557f09b92cf55a6a813fd980e7c25e1a7b
Ancestor: 5d1cd42e92b6d03e3c1556c107bf4e6174743813
Author: evands at pidgin.im
Date: 2010-05-15T19:16:38
Branch: im.pidgin.adium.1-4
URL: http://d.pidgin.im/viewmtn/revision/info/fa7af7557f09b92cf55a6a813fd980e7c25e1a7b

Modified files:
        libpurple/protocols/oscar/family_icbm.c
        libpurple/protocols/oscar/oscar.c
        libpurple/protocols/oscar/oscar.h

ChangeLog: 

Manually applied the changes to oscar from im.pidgin.pidgin which fix receiving & sending of HTML via ICQ

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/family_icbm.c	d202b35b83353a3e4b4f72fb372e44fe6b02a015
+++ libpurple/protocols/oscar/family_icbm.c	c4a30f422cecaa7113ba980d9bec607334508a29
@@ -274,7 +274,8 @@ static int aim_im_paraminfo(OscarData *o
 			| AIM_IMPARAM_FLAG_MISSED_CALLS_ENABLED
 			| AIM_IMPARAM_FLAG_EVENTS_ALLOWED
 			| AIM_IMPARAM_FLAG_SMS_SUPPORTED
-			| AIM_IMPARAM_FLAG_OFFLINE_MSGS_ALLOWED;
+			| AIM_IMPARAM_FLAG_OFFLINE_MSGS_ALLOWED
+			| AIM_IMPARAM_FLAG_USE_HTML_FOR_ICQ;	
 	params.maxmsglen = 8000;
 	params.minmsginterval = 0;
 
============================================================
--- libpurple/protocols/oscar/oscar.c	b34faed2a5aec4e83f69ea80191b89bb3e13cbb4
+++ libpurple/protocols/oscar/oscar.c	73b32a33724f06e06014b5b81aa5284a9cad1a43
@@ -2440,25 +2440,6 @@ static int incomingim_chan1(OscarData *o
 	tmp = g_string_free(message, FALSE);
 
 	/*
-	 * If the message is from an ICQ user and to an ICQ user then escape any HTML,
-	 * because HTML is not sent over ICQ as a means to format a message.
-	 * So any HTML we receive is intended to be displayed.  Also, \r\n must be
-	 * replaced with <br>
-	 *
-	 * Note: There *may* be some clients which send messages as HTML formatted -
-	 *       they need to be special-cased somehow.
-	 */
-	if (od->icq && oscar_util_valid_name_icq(userinfo->bn)) {
-		/* 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);
-		tmp = tmp2;
-		tmp2 = purple_strreplace(tmp, "\r\n", "<br>");
-		g_free(tmp);
-		tmp = tmp2;
-	}
-
-	/*
 	 * Convert iChat color tags to normal font tags.
 	 */
 	if (purple_markup_find_tag("body", tmp, &start, &end, &attribs))
@@ -4692,25 +4673,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;
 		}
============================================================
--- libpurple/protocols/oscar/oscar.h	cadfcafae1171988f9e4aca916d6f0abeeeb1b75
+++ libpurple/protocols/oscar/oscar.h	50bde924a4a7c461b8ac1bd26ff6b67d9256693a
@@ -742,6 +742,20 @@ void aim_ads_requestads(OscarData *od, F
 #define AIM_IMPARAM_FLAG_SMS_SUPPORTED          0x00000010
 #define AIM_IMPARAM_FLAG_OFFLINE_MSGS_ALLOWED   0x00000100
 
+/**
+* This flag tells the server that we always send HTML in messages
+* sent from an ICQ account to an ICQ account.  (If this flag is
+* not sent then plaintext is sent ICQ<-->ICQ (HTML is sent in all
+* other cases)).
+*
+* If we send an HTML message to an old client that doesn't support
+* HTML messages, then the oscar servers will merrily strip the HTML
+* for us.
+*
+* All incoming IMs are treated as HTML.
+*/
+#define AIM_IMPARAM_FLAG_USE_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. */
 #define AIM_IMPARAM_DEFAULTS { \


More information about the Commits mailing list