diff --git a/PBot/AntiFlood.pm b/PBot/AntiFlood.pm index 16ab2ec3..a678f1ab 100644 --- a/PBot/AntiFlood.pm +++ b/PBot/AntiFlood.pm @@ -107,12 +107,18 @@ sub check_flood { if($mode == $self->{FLOOD_JOIN}) { if($text =~ /^JOIN/) { ${ $self->message_history }{$account}{$channel}{join_watch}++; + $self->{pbot}->logger->log("$nick $channel joinwatch adjusted: ${ $self->message_history }{$account}{$channel}{join_watch}\n"); } 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 =~ /^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; + # PART or QUIT -- check QUIT message for netsplits, and decrement joinwatch if found + if($text =~ /^QUIT .*\.net .*\.split/) { + foreach my $ch (keys %{ $self->message_history->{$account} }) { + next if $ch eq 'hostmask'; # TODO: move channels into {channel} subkey + ${ $self->message_history }{$account}{$ch}{join_watch}--; + ${ $self->message_history }{$account}{$ch}{join_watch} = 0 if ${ $self->message_history }{$account}{$ch}{join_watch} < 0; + $self->{pbot}->logger->log("$nick $ch joinwatch adjusted: ${ $self->message_history }{$account}{$ch}{join_watch}\n"); + } + } } - $self->{pbot}->logger->log("$nick $channel joinwatch adjusted: ${ $self->message_history }{$account}{$channel}{join_watch}\n"); } elsif($mode == $self->{FLOOD_CHAT}) { ${ $self->message_history }{$account}{$channel}{join_watch} = 0; } diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 6f0ea06a..fdf7bd0d 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,8 +13,8 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 156, - BUILD_DATE => "2010-06-10", + BUILD_REVISION => 157, + BUILD_DATE => "2010-06-11", }; 1;