mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-29 23:39:24 +01:00
Correct joinwatch behavior for netsplits; remove joinwatch behavior for "Changing host"
This commit is contained in:
parent
0ce7f52725
commit
4242eecf43
@ -107,12 +107,18 @@ sub check_flood {
|
|||||||
if($mode == $self->{FLOOD_JOIN}) {
|
if($mode == $self->{FLOOD_JOIN}) {
|
||||||
if($text =~ /^JOIN/) {
|
if($text =~ /^JOIN/) {
|
||||||
${ $self->message_history }{$account}{$channel}{join_watch}++;
|
${ $self->message_history }{$account}{$channel}{join_watch}++;
|
||||||
|
$self->{pbot}->logger->log("$nick $channel joinwatch adjusted: ${ $self->message_history }{$account}{$channel}{join_watch}\n");
|
||||||
} else {
|
} else {
|
||||||
# PART or QUIT -- check PART/QUIT message for netsplits or changing host, and decrement joinwatch if found
|
# PART or QUIT -- check QUIT message for netsplits, and decrement joinwatch if found
|
||||||
${ $self->message_history }{$account}{$channel}{join_watch}-- if($text =~ /^QUIT Changing host/ or $text =~ /^QUIT .*\.net .*\.split/);
|
if($text =~ /^QUIT .*\.net .*\.split/) {
|
||||||
${ $self->message_history }{$account}{$channel}{join_watch} = 0 if ${ $self->message_history }{$account}{$channel}{join_watch} < 0;
|
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}) {
|
} elsif($mode == $self->{FLOOD_CHAT}) {
|
||||||
${ $self->message_history }{$account}{$channel}{join_watch} = 0;
|
${ $self->message_history }{$account}{$channel}{join_watch} = 0;
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,8 @@ 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 => 156,
|
BUILD_REVISION => 157,
|
||||||
BUILD_DATE => "2010-06-10",
|
BUILD_DATE => "2010-06-11",
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user