diff console/gntconv.c @ 14030:0e70bb6d32fd

[gaim-migrate @ 16632] Do not auto-scroll when I am reading the backlog. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 05 Aug 2006 02:56:18 +0000
parents 7109e6397a31
children c5bfede33622
line wrap: on
line diff
--- a/console/gntconv.c	Sat Aug 05 02:19:19 2006 +0000
+++ b/console/gntconv.c	Sat Aug 05 02:56:18 2006 +0000
@@ -221,6 +221,7 @@
 	GGConv *ggconv = g_hash_table_lookup(ggconvs, conv); /* XXX: ggconv = conv->ui_data; should do */
 	char *strip, *newline;
 	GntTextFormatFlags fl = 0;
+	int pos;
 
 	g_return_if_fail(ggconv != NULL);
 
@@ -239,13 +240,16 @@
 	if (flags & GAIM_MESSAGE_NICK)
 		fl |= GNT_TEXT_FLAG_UNDERLINE;
 
+	pos = gnt_text_view_get_lines_below(GNT_TEXT_VIEW(ggconv->tv));
+
 	/* 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);
+	if (pos <= 1)
+		gnt_text_view_scroll(GNT_TEXT_VIEW(ggconv->tv), 0);
 
 	g_free(newline);
 	g_free(strip);