From 367ee369036da109375cfa4de6c390c18382f01a Mon Sep 17 00:00:00 2001
From: simonraven <simonraven@c11ca15a-4712-0410-83d8-924469b57eb5>
Date: Tue, 6 Mar 2007 21:41:41 +0000
Subject: [PATCH] If topicAuthor is on then show it in topic, otherwise just
 topic -- contribution by troubled

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@1301 c11ca15a-4712-0410-83d8-924469b57eb5
---
 blootbot/files/sample/blootbot.config | 5 +++++
 blootbot/src/Modules/Topic.pl         | 5 ++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/blootbot/files/sample/blootbot.config b/blootbot/files/sample/blootbot.config
index 246ed2e..1ac6c8c 100644
--- a/blootbot/files/sample/blootbot.config
+++ b/blootbot/files/sample/blootbot.config
@@ -216,6 +216,11 @@ set useStrict		1
 #   CLI		-- Command Line Interface
 set Interface		IRC
 
+# [0/1] Show topic author (troubled)
+# If 1, topics managed with !topic add foo will show the nick in ()'s
+# If 0, the nick of the creator will be recorded for !topic list, but not shown in the topic itself
+set topicAuthor 1
+
 ####
 # Now modify blootbot.chan for per-channel specific configuration see
 # sample.chans for info.
diff --git a/blootbot/src/Modules/Topic.pl b/blootbot/src/Modules/Topic.pl
index 2a07c2e..96b0b3f 100644
--- a/blootbot/src/Modules/Topic.pl
+++ b/blootbot/src/Modules/Topic.pl
@@ -62,8 +62,11 @@ sub topicCipher {
 
 	if ($setby =~ /^(unknown|)$/i) {
 	    push(@topic, $subtopic);
-	} else {
+	# If topicAuthor is on then show it in topic, otherwise just topic -- troubled
+	} elsif ($param{'topicAuthor'} eq "1") {
 	    push(@topic, "$subtopic ($setby)");
+	} else {
+	    push(@topic, "$subtopic");
 	}
     }
 
-- 
2.39.5