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:
parent
a64d62b549
commit
363dd1fc29
@ -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}) {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user