mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-23 02:24:25 +01:00
antiflood: corrected check against double-banning chat floods
This commit is contained in:
parent
d2640f8bcb
commit
d5ba966c53
@ -227,7 +227,9 @@ sub check_flood {
|
||||
${ $self->message_history }{$account}{$channel}{offenses}++;
|
||||
my $length = ${ $self->message_history }{$account}{$channel}{offenses} ** ${ $self->message_history }{$account}{$channel}{offenses} * ${ $self->message_history }{$account}{$channel}{offenses} * 30;
|
||||
if($channel =~ /^#/) { #channel flood (opposed to private message or otherwise)
|
||||
return if exists $self->{pbot}->chanops->{unban_timeout}->hash->{"*!*\@$host"};
|
||||
# don't ban again if already banned
|
||||
return if exists $self->{pbot}->chanops->{unban_timeout}->hash->{"*!$user\@$host"};
|
||||
|
||||
if($mode == $self->{FLOOD_CHAT}) {
|
||||
$self->{pbot}->chanops->ban_user_timed("*!$user\@$host", $channel, $length);
|
||||
|
||||
|
@ -13,7 +13,7 @@ use warnings;
|
||||
# These are set automatically by the build/commit script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 241,
|
||||
BUILD_REVISION => 242,
|
||||
BUILD_DATE => "2011-01-21",
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user