3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 09:58:42 +02:00

IgnoreList: properly set global channel; fix whitespace in ignore list

This commit is contained in:
Pragmatic Software 2020-04-29 16:55:09 -07:00
parent 5e7955a51b
commit 88a13847c8

View File

@ -63,6 +63,8 @@ sub add {
$hostmask .= '@*'; $hostmask .= '@*';
} }
$channel = '.*' if $channel !~ /^#/;
my $regex = quotemeta $hostmask; my $regex = quotemeta $hostmask;
$regex =~ s/\\\*/.*?/g; $regex =~ s/\\\*/.*?/g;
$regex =~ s/\\\?/./g; $regex =~ s/\\\?/./g;
@ -103,6 +105,8 @@ sub remove {
$hostmask .= '@*'; $hostmask .= '@*';
} }
$channel = '.*' if $channel !~ /^#/;
$self->{pbot}->{timer}->dequeue_event("ignore_timeout $channel $hostmask"); $self->{pbot}->{timer}->dequeue_event("ignore_timeout $channel $hostmask");
return $self->{ignorelist}->remove($channel, $hostmask); return $self->{ignorelist}->remove($channel, $hostmask);
} }