changeset 8359:05c174138e94

[gaim-migrate @ 9083] Was there a reason html was being stripped from outgoing oscar chat messages? I mean, aside from it being good for mankind and everything? committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 28 Feb 2004 17:08:08 +0000
parents bd3c028bff29
children 8d012c803411
files src/gtkimhtmltoolbar.c src/protocols/oscar/oscar.c
diffstat 2 files changed, 22 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkimhtmltoolbar.c	Sat Feb 28 14:27:31 2004 +0000
+++ b/src/gtkimhtmltoolbar.c	Sat Feb 28 17:08:08 2004 +0000
@@ -274,7 +274,7 @@
 		  &bgcolor);*/
 		if (!toolbar->bgcolor_dialog) {
 
-			toolbar->bgcolor_dialog = gtk_color_selection_dialog_new(_("Select Text Color"));
+			toolbar->bgcolor_dialog = gtk_color_selection_dialog_new(_("Select Background Color"));
 			colorsel = GTK_COLOR_SELECTION_DIALOG(toolbar->bgcolor_dialog)->colorsel;
 			//gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(colorsel), &bgcolor);
 			g_object_set_data(G_OBJECT(colorsel), "gaim_toolbar", toolbar);
--- a/src/protocols/oscar/oscar.c	Sat Feb 28 14:27:31 2004 +0000
+++ b/src/protocols/oscar/oscar.c	Sat Feb 28 17:08:08 2004 +0000
@@ -5517,35 +5517,31 @@
 
 	encoding = oscar_encoding_check(buf);
 	if (encoding & AIM_IMFLAGS_UNICODE) {
-		gaim_debug(GAIM_DEBUG_INFO, "oscar", "Sending Unicode Chat\n");
+		gaim_debug(GAIM_DEBUG_INFO, "oscar", "Sending Unicode chat\n");
 		charset = "unicode-2-0";
 		buf2 = g_convert(buf, len, "UCS-2BE", "UTF-8", NULL, &len, &err);
 		if (err) {
 			gaim_debug(GAIM_DEBUG_ERROR, "oscar",
-					   "Error converting a unicode message: %s\n",
-					   err->message);
-			gaim_debug(GAIM_DEBUG_ERROR, "oscar",
-					   "This really shouldn't happen!\n");
-			/* We really shouldn't try to send the
-			* IM now, but I'm not sure what to do */
-	    g_error_free(err);
-	  }
+					   "Error converting to unicode-2-0: %s\n", err->message);
+			g_error_free(err);
+		}
 	} else if (encoding & AIM_IMFLAGS_ISO_8859_1) {
-		gaim_debug(GAIM_DEBUG_INFO, "oscar",
-				   "Sending ISO-8859-1 Chat\n");
+		gaim_debug(GAIM_DEBUG_INFO, "oscar", "Sending ISO-8859-1 chat\n");
 		charset = "iso-8859-1";
 		buf2 = g_convert(buf, len, "ISO-8859-1", "UTF-8", NULL, &len, &err);
 		if (err) {
 			gaim_debug(GAIM_DEBUG_ERROR, "oscar",
-					   "conversion error: %s\n", err->message);
-			gaim_debug(GAIM_DEBUG_ERROR, "oscar",
-					   "Someone tell Ethan his 8859-1 detection is wrong\n");
+					   "Error converting to iso-8859-1: %s\n", err->message);
 			g_error_free(err);
-			encoding = AIM_IMFLAGS_UNICODE;
-			buf2 = g_convert(buf, len, "UCS-2BE", "UTF8", NULL, &len, &err);
+			err = NULL;
+
+			gaim_debug(GAIM_DEBUG_INFO, "oscar", "Falling back to Unicode\n");
+			charset = "unicode-2-0";
+			buf2 = g_convert(buf, len, "UCS-2BE", "UTF-8", NULL, &len, &err);
 			if (err) {
 				gaim_debug(GAIM_DEBUG_ERROR, "oscar",
-						   "Error in unicode fallback: %s\n", err->message);
+						   "Error converting to unicode-2-0: %s\n",
+						   err->message);
 				g_error_free(err);
 			}
 		}
@@ -5553,21 +5549,16 @@
 	  charset = "us-ascii";
 	  buf2 = g_strdup(buf);
 	}
-
-	if (len > c->maxlen)
+	g_free(buf);
+
+	if ((len > c->maxlen) || (len > c->maxvis)) {
+		g_free(buf2);
 		return -E2BIG;
-
-	g_free(buf);
-	buf = gaim_markup_strip_html(buf2);
-	len = strlen(buf);
+	}
+
+	aim_chat_send_im(od->sess, c->conn, 0, buf2, len, charset, "en");
 	g_free(buf2);
-	if (len > c->maxvis) {
-		g_free(buf);
-		return -E2BIG;
-	}
-
-	aim_chat_send_im(od->sess, c->conn, 0, buf, len, charset, "en");
-	g_free(buf);
+
 	return 0;
 }