From 363dd1fc295703fcb8169cda1d90cb8d0776f38e Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 10 Jun 2010 19:20:12 +0000 Subject: [PATCH] Show anti-flood timestamp comparisons for join floods only (to reduce log traffic) --- PBot/AntiFlood.pm | 4 ++-- PBot/VERSION.pm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PBot/AntiFlood.pm b/PBot/AntiFlood.pm index 9229ebbe..05b59075 100644 --- a/PBot/AntiFlood.pm +++ b/PBot/AntiFlood.pm @@ -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}) { diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 623e89e3..1454f709 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -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;