mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-27 13:12:42 +01:00
AntiSpam: "unless" is too confusing
This commit is contained in:
parent
e861c9dea2
commit
bb11282e13
@ -50,9 +50,10 @@ sub is_spam {
|
||||
|
||||
my $ret = eval {
|
||||
foreach my $space (keys %{ $self->{keywords}->hash }) {
|
||||
next unless $all_namespaces and $namespace =~ m/^$space$/i;
|
||||
foreach my $keyword (keys %{ $self->{keywords}->hash->{$space} }) {
|
||||
return 1 if $text =~ m/$keyword/i;
|
||||
if ($all_namespaces or $namespace =~ m/^$space$/i) {
|
||||
foreach my $keyword (keys %{ $self->{keywords}->hash->{$space} }) {
|
||||
return 1 if $text =~ m/$keyword/i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user