3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-04 18:38:47 +02:00

antiflood: corrected check against double-banning chat floods

This commit is contained in:
Pragmatic Software 2011-01-22 04:42:38 +00:00
parent d2640f8bcb
commit d5ba966c53
2 changed files with 4 additions and 2 deletions

View File

@ -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);

View File

@ -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",
};