3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-19 10:29:30 +01:00

Display join flood history only if joinwatch >= max joins, to reduce log spam

This commit is contained in:
Pragmatic Software 2010-06-29 00:59:47 +00:00
parent fe6d08178b
commit 58f19984bf
2 changed files with 4 additions and 4 deletions

View File

@ -190,9 +190,9 @@ sub check_flood {
} else {
my $count = 0;
my $i = $length - 1;
$self->{pbot}->logger->log("Checking flood history, i = $i\n");
$self->{pbot}->logger->log("Checking flood history, i = $i\n") if ${ $self->message_history }{$account}{$channel}{join_watch} >= $max_messages;
for(; $i >= 0; $i--) {
$self->{pbot}->logger->log($i . " " . $self->message_history->{$account}{$channel}{messages}->[$i]{mode} ." " . $self->message_history->{$account}{$channel}{messages}->[$i]{msg} . " " . $self->message_history->{$account}{$channel}{messages}->[$i]{timestamp} . " [" . ago_exact(time - $self->message_history->{$account}{$channel}{messages}->[$i]{timestamp}) . "]\n");
$self->{pbot}->logger->log($i . " " . $self->message_history->{$account}{$channel}{messages}->[$i]{mode} ." " . $self->message_history->{$account}{$channel}{messages}->[$i]{msg} . " " . $self->message_history->{$account}{$channel}{messages}->[$i]{timestamp} . " [" . ago_exact(time - $self->message_history->{$account}{$channel}{messages}->[$i]{timestamp}) . "]\n") if ${ $self->message_history }{$account}{$channel}{join_watch} >= $max_messages;
next if $self->message_history->{$account}{$channel}{messages}->[$i]{mode} != $self->{FLOOD_JOIN};
last if ++$count >= 4;
}

View File

@ -13,8 +13,8 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 209,
BUILD_DATE => "2010-06-27",
BUILD_REVISION => 210,
BUILD_DATE => "2010-06-28",
};
1;