3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-01 17:16:39 +02:00

Make join flood more robust

This commit is contained in:
Pragmatic Software 2010-06-11 04:03:36 +00:00
parent b7cd3cfbfc
commit da7eb0b111
2 changed files with 3 additions and 3 deletions

View File

@ -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($mode == $self->{FLOOD_JOIN}) {
if($text eq "JOIN") {
if($text =~ /^JOIN/) {
${ $self->message_history }{$account}{$channel}{join_watch}++;
} else {
# PART or QUIT -- check PART/QUIT message for netsplits or changing host, and decrement joinwatch if found
${ $self->message_history }{$account}{$channel}{join_watch}-- if($text =~ /Changing host/ or $text =~ /.*\.net .*\.split/);
${ $self->message_history }{$account}{$channel}{join_watch}-- if($text =~ /^QUIT Changing host/ or $text =~ /^QUIT .*\.net .*\.split/);
${ $self->message_history }{$account}{$channel}{join_watch} = 0 if ${ $self->message_history }{$account}{$channel}{join_watch} < 0;
}
$self->{pbot}->logger->log("$nick $channel joinwatch adjusted: ${ $self->message_history }{$account}{$channel}{join_watch}\n");

View File

@ -13,7 +13,7 @@ use warnings;
# These are set automatically by the build/commit script
use constant {
BUILD_NAME => "PBot",
BUILD_REVISION => 154,
BUILD_REVISION => 155,
BUILD_DATE => "2010-06-10",
};