From 88a13847c88a67075bf8c81d865a0ceb1625bca0 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Wed, 29 Apr 2020 16:55:09 -0700 Subject: [PATCH] IgnoreList: properly set global channel; fix whitespace in `ignore list` --- PBot/IgnoreList.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PBot/IgnoreList.pm b/PBot/IgnoreList.pm index e6c7cbd6..683b971a 100644 --- a/PBot/IgnoreList.pm +++ b/PBot/IgnoreList.pm @@ -63,6 +63,8 @@ sub add { $hostmask .= '@*'; } + $channel = '.*' if $channel !~ /^#/; + my $regex = quotemeta $hostmask; $regex =~ s/\\\*/.*?/g; $regex =~ s/\\\?/./g; @@ -103,6 +105,8 @@ sub remove { $hostmask .= '@*'; } + $channel = '.*' if $channel !~ /^#/; + $self->{pbot}->{timer}->dequeue_event("ignore_timeout $channel $hostmask"); return $self->{ignorelist}->remove($channel, $hostmask); } @@ -130,12 +134,12 @@ sub ignore_cmd { return "Usage: ignore [channel [timeout]] | ignore list" if not defined $target; if ($target =~ /^list$/i) { - my $text = "Ignored: "; + my $text = "Ignored:"; my $now = time; my $ignored = 0; foreach my $channel (sort $self->{ignorelist}->get_keys) { - $text .= $channel eq '.*' ? "global:\n" : "$channel:\n"; + $text .= $channel eq '.*' ? " global:\n" : " $channel:\n"; my @list = (); foreach my $hostmask (sort $self->{ignorelist}->get_keys($channel)) { my $timeout = $self->{ignorelist}->get_data($channel, $hostmask, 'timeout');