mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-23 12:29:27 +01:00
AntiNickSpam: Remove severity due to "false-positive" common-word nicks
This commit is contained in:
parent
fc5f003465
commit
b4df71cd71
@ -65,15 +65,11 @@ sub check_flood {
|
|||||||
$channel = lc $channel;
|
$channel = lc $channel;
|
||||||
my @words = split /\s+/, $msg;
|
my @words = split /\s+/, $msg;
|
||||||
my @nicks;
|
my @nicks;
|
||||||
my $severity = 0; # increasing severity for each additional unique nick in a single message
|
|
||||||
|
|
||||||
foreach my $word (@words) {
|
foreach my $word (@words) {
|
||||||
$word =~ s/[:;\+,\.!?\@\%\$]+$//g;
|
$word =~ s/[:;\+,\.!?\@\%\$]+$//g;
|
||||||
if ($self->{pbot}->{nicklist}->is_present($channel, $word) and not grep { $_ eq $word } @nicks) {
|
if ($self->{pbot}->{nicklist}->is_present($channel, $word) and not grep { $_ eq $word } @nicks) {
|
||||||
$severity++;
|
push @{$self->{nicks}->{$channel}}, [scalar gettimeofday, $word];
|
||||||
for (my $i = 0; $i < $severity; $i++) {
|
|
||||||
push @{$self->{nicks}->{$channel}}, [scalar gettimeofday, $word];
|
|
||||||
}
|
|
||||||
push @nicks, $word;
|
push @nicks, $word;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user