changeset 7715:9f6dc7b4fc57

[gaim-migrate @ 8360] I didn't do this earlier, because I figured people would still want to add their own HTML tags using CVS, but I strongly doubt anyone will be hit with the overwhelming desire to manually change the font size in an IM until that gets implemented. I'm escaping HTML now. This will only happen with protocols that support HTML, other protocols will receive just the text in the box. When the toolbar gets widgetized, it will become desensitive when the current account does not support HTML. Also, because it's been asked of me, your default outgoing font will be set in the wysiwyg entry widget, and ctrl-up will show the correct formatting. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 03 Dec 2003 04:29:26 +0000
parents 3d9d3d21e600
children 911f03121652
files src/gtkconv.c src/gtkimhtml.c
diffstat 2 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkconv.c	Wed Dec 03 04:17:42 2003 +0000
+++ b/src/gtkconv.c	Wed Dec 03 04:29:26 2003 +0000
@@ -377,8 +377,11 @@
 	GaimConnection *gc = gaim_conversation_get_gc(conv);
 
 	gtkconv = GAIM_GTK_CONVERSATION(conv);
-
-	buf2 = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry));
+	
+	if (gc && gc->flags & GAIM_CONNECTION_HTML)
+		buf2 = gtk_imhtml_get_markup(GTK_IMHTML(gtkconv->entry));
+	else
+		buf2 = gtk_imhtml_get_text(GTK_IMHTML(gtkconv->entry));
 
 	/*	set_toggle(gtkconv->toolbar.bold,        FALSE);
 	set_toggle(gtkconv->toolbar.italic,      FALSE);
--- a/src/gtkimhtml.c	Wed Dec 03 04:17:42 2003 +0000
+++ b/src/gtkimhtml.c	Wed Dec 03 04:29:26 2003 +0000
@@ -2228,7 +2228,15 @@
 				}
 			 
 			}
-			
+	
+			if (c == '<')
+				str = g_string_append(str, "&lt;");
+			else if (c == '>')
+				str = g_string_append(str, "&gt;");
+			else if (c == '&')
+				str = g_string_append(str, "&amp;");
+			else if (c == '"')
+				str = g_string_append(str, "&quot;");
 			str = g_string_append_unichar(str, c);
 		}
 		gtk_text_iter_forward_char(&iter);