3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-22 18:52:40 +01:00

Show anti-flood timestamp comparisons for join floods only (to reduce log traffic)

This commit is contained in:
Pragmatic Software 2010-06-10 19:20:12 +00:00
parent a64d62b549
commit 363dd1fc29
2 changed files with 4 additions and 4 deletions

View File

@ -105,11 +105,11 @@ sub check_flood {
return if ($channel =~ /^#/) and (not exists ${ $self->{pbot}->channels->channels }{$channel} or ${ $self->{pbot}->channels->channels }{$channel}{is_op} == 0);
if($length >= $max_messages) {
$self->{pbot}->logger->log("More than $max_messages messages spoken, comparing time differences ($max_time)\n");
$self->{pbot}->logger->log("More than $max_messages messages, comparing time differences ($max_time)\n") if $mode == $self->{FLOOD_JOIN};
my %msg = %{ @{ ${ $self->message_history }{$account}{$channel}{messages} }[$length - $max_messages] };
my %last = %{ @{ ${ $self->message_history }{$account}{$channel}{messages} }[$length - 1] };
$self->{pbot}->logger->log("Comparing " . int($last{timestamp}) . " against " . int($msg{timestamp}) . ": " . (int($last{timestamp} - $msg{timestamp})) . " seconds\n");
$self->{pbot}->logger->log("Comparing " . int($last{timestamp}) . " against " . int($msg{timestamp}) . ": " . (int($last{timestamp} - $msg{timestamp})) . " seconds\n") if $mode == $self->{FLOOD_JOIN};
if($last{timestamp} - $msg{timestamp} <= $max_time && not $self->{pbot}->admins->loggedin($channel, "$nick!$user\@$host")) {
if($mode == $self->{FLOOD_JOIN}) {

View File

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