From: dms Date: Wed, 13 Aug 2003 16:12:57 +0000 (+0000) Subject: - deleting all topics works now. X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b50ba95a874419acbf9420486260afd017854211;p=infobot.git - deleting all topics works now. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk@799 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/blootbot/src/Modules/Topic.pl b/blootbot/src/Modules/Topic.pl index 22df33e..58653f5 100644 --- a/blootbot/src/Modules/Topic.pl +++ b/blootbot/src/Modules/Topic.pl @@ -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)");