3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-04 18:38:47 +02:00

AntiRepeat: allow really short messages since "yep" "ok" etc are so common

This commit is contained in:
Pragmatic Software 2017-12-15 16:23:36 -08:00
parent 317fe72230
commit c42f03ed27

View File

@ -87,6 +87,7 @@ sub on_public {
foreach my $string1 (@$messages) {
next if $now - $string1->{timestamp} > 60 * 60 * 2;
next if $allow_bot and $string1->{msg} =~ m/^(?:$bot_trigger|$botnick.?)/;
next if length $string1 <= 5; # allow really short messages since "yep" "ok" etc are so common
if (exists $self->{offenses}->{$account} and exists $self->{offenses}->{$account}->{$channel}) {
next if $self->{offenses}->{$account}->{$channel}->{last_offense} >= $string1->{timestamp};
@ -95,6 +96,7 @@ sub on_public {
foreach my $string2 (@$messages) {
next if $now - $string2->{timestamp} > 60 * 60 * 2;
next if $allow_bot and $string2->{msg} =~ m/^(?:$bot_trigger|$botnick.?)/;
next if length $string2 <= 5; # allow really short messages since "yep" "ok" etc are so common
if (exists $self->{offenses}->{$account} and exists $self->{offenses}->{$account}->{$channel}) {
next if $self->{offenses}->{$account}->{$channel}->{last_offense} >= $string2->{timestamp};