mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-20 02:49:49 +01:00
IgnoreList: properly set global channel; fix whitespace in ignore list
This commit is contained in:
parent
5e7955a51b
commit
88a13847c8
@ -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);
|
||||||
}
|
}
|
||||||
@ -130,12 +134,12 @@ sub ignore_cmd {
|
|||||||
return "Usage: ignore <hostmask> [channel [timeout]] | ignore list" if not defined $target;
|
return "Usage: ignore <hostmask> [channel [timeout]] | ignore list" if not defined $target;
|
||||||
|
|
||||||
if ($target =~ /^list$/i) {
|
if ($target =~ /^list$/i) {
|
||||||
my $text = "Ignored: ";
|
my $text = "Ignored:";
|
||||||
my $now = time;
|
my $now = time;
|
||||||
my $ignored = 0;
|
my $ignored = 0;
|
||||||
|
|
||||||
foreach my $channel (sort $self->{ignorelist}->get_keys) {
|
foreach my $channel (sort $self->{ignorelist}->get_keys) {
|
||||||
$text .= $channel eq '.*' ? "global:\n" : "$channel:\n";
|
$text .= $channel eq '.*' ? " global:\n" : " $channel:\n";
|
||||||
my @list = ();
|
my @list = ();
|
||||||
foreach my $hostmask (sort $self->{ignorelist}->get_keys($channel)) {
|
foreach my $hostmask (sort $self->{ignorelist}->get_keys($channel)) {
|
||||||
my $timeout = $self->{ignorelist}->get_data($channel, $hostmask, 'timeout');
|
my $timeout = $self->{ignorelist}->get_data($channel, $hostmask, 'timeout');
|
||||||
|
Loading…
Reference in New Issue
Block a user