mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-19 10:29:30 +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);
|
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($mode == $self->{FLOOD_JOIN}) {
|
||||||
if($text eq "JOIN") {
|
if($text =~ /^JOIN/) {
|
||||||
${ $self->message_history }{$account}{$channel}{join_watch}++;
|
${ $self->message_history }{$account}{$channel}{join_watch}++;
|
||||||
} else {
|
} else {
|
||||||
# PART or QUIT -- check PART/QUIT message for netsplits or changing host, and decrement joinwatch if found
|
# 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->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");
|
$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
|
# These are set automatically by the build/commit script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 154,
|
BUILD_REVISION => 155,
|
||||||
BUILD_DATE => "2010-06-10",
|
BUILD_DATE => "2010-06-10",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user