mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-22 18:52:40 +01:00
Make join flood more robust
This commit is contained in:
parent
b7cd3cfbfc
commit
da7eb0b111
@ -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");
|
||||
|
@ -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",
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user