]> git.donarmstrong.com Git - infobot.git/commitdiff
- deleting all topics works now.
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 13 Aug 2003 16:12:57 +0000 (16:12 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Wed, 13 Aug 2003 16:12:57 +0000 (16:12 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@799 c11ca15a-4712-0410-83d8-924469b57eb5

blootbot/src/Modules/Topic.pl

index 22df33e940f50788d5d89d503439c96df9fd1b17..58653f5bbe27e54a370e05db02252048dfa273c8 100644 (file)
@@ -54,10 +54,7 @@ sub topicDecipher {
 ###
 # Usage: &topicCipher(@topics);
 sub topicCipher {
-    if (!@_) {
-       &WARN("topicCipher: topic is NULL for $chan.");
-       return;
-    }
+    return if (!@_);
 
     my @topic;
     foreach (@_) {
@@ -104,7 +101,7 @@ sub topicNew {
        return 1;
     }
 
-    if ($updateMsg ne "") {
+    if (defined $updateMsg && $updateMsg ne "") {
        &msg($who, $updateMsg);
     }
 
@@ -112,8 +109,12 @@ sub topicNew {
     $topic{$chan}{'Who'}  = $orig{who}."!".$uh;
     $topic{$chan}{'Time'} = time();
 
-    $conn->topic($chan, $topic);
-    &topicAddHistory($chan, $topic);
+    if ($topic) {
+       $conn->topic($chan, $topic);
+       &topicAddHistory($chan, $topic);
+    } else {
+       $conn->topic($chan, " ");
+    }
 
     return 1;
 }
@@ -227,7 +228,6 @@ sub do_delete {
        $topic{$chan}{'What'} = "Deleted ".join("/",@delete);
     }
 
-
     foreach (@delete) {
        if ($_ > $topiccount || $_ < 1) {
            &msg($who, "error: argument out of range. (max: $topiccount)");