###
# Usage: &topicCipher(@topics);
sub topicCipher {
- if (!@_) {
- &WARN("topicCipher: topic is NULL for $chan.");
- return;
- }
+ return if (!@_);
my @topic;
foreach (@_) {
return 1;
}
- if ($updateMsg ne "") {
+ if (defined $updateMsg && $updateMsg ne "") {
&msg($who, $updateMsg);
}
$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;
}
$topic{$chan}{'What'} = "Deleted ".join("/",@delete);
}
-
foreach (@delete) {
if ($_ > $topiccount || $_ < 1) {
&msg($who, "error: argument out of range. (max: $topiccount)");