summary refs log tree commit diff stats
path: root/src/fe-gtk/fe-gtk.c
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2012-09-01 21:38:00 +0200
committerBerke Viktor <bviktor@hexchat.org>2012-09-01 21:38:00 +0200
commit4f887a1e536044cca9b4a865917ca56288032b07 (patch)
tree10c841790aa7bd5532743facd59afb203b9204aa /src/fe-gtk/fe-gtk.c
parentfb00928c9df3a8152113674f4b85ba0fdf1679c8 (diff)
Consolidate color stripping for messages, topic and scrollback
Diffstat (limited to 'src/fe-gtk/fe-gtk.c')
-rw-r--r--src/fe-gtk/fe-gtk.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/fe-gtk/fe-gtk.c b/src/fe-gtk/fe-gtk.c
index 706ab776..cb9c0376 100644
--- a/src/fe-gtk/fe-gtk.c
+++ b/src/fe-gtk/fe-gtk.c
@@ -552,13 +552,31 @@ fe_set_topic (session *sess, char *topic, char *stripped_topic)
 {
 	if (!sess->gui->is_tab || sess == current_tab)
 	{
-		gtk_entry_set_text (GTK_ENTRY (sess->gui->topic_entry), stripped_topic);
+		if (prefs.text_stripcolor_topic)
+		{
+			gtk_entry_set_text (GTK_ENTRY (sess->gui->topic_entry), stripped_topic);
+		}
+		else
+		{
+			gtk_entry_set_text (GTK_ENTRY (sess->gui->topic_entry), topic);
+		}
 		mg_set_topic_tip (sess);
-	} else
+	}
+	else
 	{
 		if (sess->res->topic_text)
+		{
 			free (sess->res->topic_text);
-		sess->res->topic_text = strdup (stripped_topic);
+		}
+
+		if (prefs.text_stripcolor_topic)
+		{
+			sess->res->topic_text = strdup (stripped_topic);
+		}
+		else
+		{
+			sess->res->topic_text = strdup (topic);
+		}
 	}
 }