mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-10 20:12:35 +01:00
antiflood: change banfoward timeout first offense to start from 8 hours instead of 32 hours
This commit is contained in:
parent
22c1673f3d
commit
ed797ca5cf
@ -212,14 +212,14 @@ sub check_flood {
|
||||
|
||||
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 [" . duration_exact($last{timestamp} - $msg{timestamp}) . "]\n") if $mode == $self->{FLOOD_JOIN};
|
||||
$self->{pbot}->logger->log("Comparing $nick!$user\@$host " . int($last{timestamp}) . " against " . int($msg{timestamp}) . ": " . (int($last{timestamp} - $msg{timestamp})) . " seconds [" . duration_exact($last{timestamp} - $msg{timestamp}) . "]\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}) {
|
||||
if(${ $self->message_history }{$account}{$channel}{join_watch} >= $max_messages) {
|
||||
${ $self->message_history }{$account}{$channel}{offenses}++;
|
||||
|
||||
my $timeout = (2 ** (($self->message_history->{$account}{$channel}{offenses} + 4) < 10 ? ${ $self->message_history }{$account}{$channel}{offenses} + 4 : 10));
|
||||
my $timeout = (2 ** (($self->message_history->{$account}{$channel}{offenses} + 2) < 10 ? ${ $self->message_history }{$account}{$channel}{offenses} + 2 : 10));
|
||||
|
||||
my $banmask = address_to_mask($host);
|
||||
|
||||
|
@ -13,8 +13,8 @@ use warnings;
|
||||
# These are set automatically by the build/commit script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 249,
|
||||
BUILD_DATE => "2011-01-23",
|
||||
BUILD_REVISION => 250,
|
||||
BUILD_DATE => "2011-01-24",
|
||||
};
|
||||
|
||||
1;
|
||||
|
Loading…
Reference in New Issue
Block a user