]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/Topic.pl
major re-organisation of the different SQL files; cleanup and fixing of the postgres...
[infobot.git] / src / Modules / Topic.pl
index 58653f5bbe27e54a370e05db02252048dfa273c8..10f0f7720843dd44545af327540724f7a09530d6 100644 (file)
@@ -60,10 +60,10 @@ sub topicCipher {
     foreach (@_) {
        my ($subtopic, $setby) = split /\|\|/;
 
-       if ($setby =~ /^(unknown|)$/i) {
-           push(@topic, $subtopic);
-       } else {
+       if ($param{'topicAuthor'} eq "1" and (!$setby =~ /^(unknown|)$/i)) {
            push(@topic, "$subtopic ($setby)");
+       } else {
+           push(@topic, "$subtopic");
        }
     }
 
@@ -164,10 +164,16 @@ sub do_add {
        return;
     }
 
-    return unless (&hasFlag("T"));
+    return if ($channels{$chan}{t} and !&hasFlag("T"));
 
     my @prev = &topicDecipher($chan);
-    my $new  = "$args ($orig{who})";
+    my $new;
+    # If bot new to chan and topic is blank, it still got a (owner). This is fix
+    if ($param{'topicAuthor'} eq "1") {
+       $new  = "$args ($orig{who})";
+    } else {
+       $new  = "$args";
+    }
     $topic{$chan}{'What'} = "Added '$args'.";
 
     if (scalar @prev) {
@@ -552,7 +558,7 @@ sub Topic {
        &do_info($chan);
 
     } else {
-       ### CMD: HELP:
+       ### HELP:
        if ($cmd ne "" and $cmd !~ /^help/i) {
            &msg($who, "Invalid command [$cmd].");
            &msg($who, "Try 'help topic'.");