changeset 14011:735c4e927eb8

[gaim-migrate @ 16603] wabz says: "gaim_strdup_withhtml in util.c is purely for converting linebreaks to <br> - some protocols use it for various reasons, but not msn - not sure where it's done for that (might not be? gtkconv doesnt use gaim_markup_strip_html). i reckon since you're using gaim_markup_strip_html, you may as well play it safe and just use gaim_strdup_withhtml before the strip?" So let's do it until GntTextView can parse html. (after all, that's 20% of the users ;) ) committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 31 Jul 2006 23:56:35 +0000
parents 7573bd40a190
children 086a3d208b22
files console/gntconv.c console/libgnt/gntwidget.c
diffstat 2 files changed, 18 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/console/gntconv.c	Mon Jul 31 23:19:12 2006 +0000
+++ b/console/gntconv.c	Mon Jul 31 23:56:35 2006 +0000
@@ -216,7 +216,7 @@
 		GaimMessageFlags flags, time_t mtime)
 {
 	GGConv *ggconv = g_hash_table_lookup(ggconvs, conv); /* XXX: ggconv = conv->ui_data; should do */
-	char *strip;
+	char *strip, *newline;
 	GntTextFormatFlags fl = 0;
 
 	g_return_if_fail(ggconv != NULL);
@@ -236,12 +236,15 @@
 	if (flags & GAIM_MESSAGE_NICK)
 		fl |= GNT_TEXT_FLAG_UNDERLINE;
 
-	strip = gaim_markup_strip_html(message);
+	/* XXX: Remove this workaround when textview can parse messages. */
+	newline = gaim_strdup_withhtml(message);
+	strip = gaim_markup_strip_html(newline);
 	gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(ggconv->tv),
 				strip, fl);
 	gnt_text_view_next_line(GNT_TEXT_VIEW(ggconv->tv));
 	gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 0);
 
+	g_free(newline);
 	g_free(strip);
 
 	if (flags & (GAIM_MESSAGE_RECV | GAIM_MESSAGE_NICK | GAIM_MESSAGE_ERROR))
--- a/console/libgnt/gntwidget.c	Mon Jul 31 23:19:12 2006 +0000
+++ b/console/libgnt/gntwidget.c	Mon Jul 31 23:56:35 2006 +0000
@@ -387,14 +387,19 @@
 	{
 		/* - This is ugly. */
 		/* - What's your point? */
-		mvwvline(widget->window, 0, 0, ACS_VLINE, widget->priv.height);
-		mvwvline(widget->window, 0, widget->priv.width - 1, ACS_VLINE, widget->priv.height);
-		mvwhline(widget->window, widget->priv.height - 1, 0, ACS_HLINE, widget->priv.width);
-		mvwhline(widget->window, 0, 0, ACS_HLINE, widget->priv.width);
-		mvwaddch(widget->window, 0, 0, ACS_ULCORNER);
-		mvwaddch(widget->window, 0, widget->priv.width - 1, ACS_URCORNER);
-		mvwaddch(widget->window, widget->priv.height - 1, 0, ACS_LLCORNER);
-		mvwaddch(widget->window, widget->priv.height - 1, widget->priv.width - 1, ACS_LRCORNER);
+		mvwvline(widget->window, 0, 0, ACS_VLINE | COLOR_PAIR(GNT_COLOR_NORMAL), widget->priv.height);
+		mvwvline(widget->window, 0, widget->priv.width - 1,
+				ACS_VLINE | COLOR_PAIR(GNT_COLOR_NORMAL), widget->priv.height);
+		mvwhline(widget->window, widget->priv.height - 1, 0,
+				ACS_HLINE | COLOR_PAIR(GNT_COLOR_NORMAL), widget->priv.width);
+		mvwhline(widget->window, 0, 0, ACS_HLINE | COLOR_PAIR(GNT_COLOR_NORMAL), widget->priv.width);
+		mvwaddch(widget->window, 0, 0, ACS_ULCORNER | COLOR_PAIR(GNT_COLOR_NORMAL));
+		mvwaddch(widget->window, 0, widget->priv.width - 1,
+				ACS_URCORNER | COLOR_PAIR(GNT_COLOR_NORMAL));
+		mvwaddch(widget->window, widget->priv.height - 1, 0,
+				ACS_LLCORNER | COLOR_PAIR(GNT_COLOR_NORMAL));
+		mvwaddch(widget->window, widget->priv.height - 1, widget->priv.width - 1,
+				ACS_LRCORNER | COLOR_PAIR(GNT_COLOR_NORMAL));
 	}
 
 	if (shadow)