mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-11 04:22:35 +01:00
antiflood: remove generate_random_number; ping timeouts/excess floods no longer treated aggressively, now treated same as other quit/parts
This commit is contained in:
parent
e943790827
commit
d2640f8bcb
@ -93,11 +93,11 @@ sub add_message {
|
|||||||
$self->{pbot}->logger->log("$account $channel joinwatch adjusted: ${ $self->message_history }{$account}{$channel}{join_watch}\n");
|
$self->{pbot}->logger->log("$account $channel joinwatch adjusted: ${ $self->message_history }{$account}{$channel}{join_watch}\n");
|
||||||
$self->message_history->{$account}{$channel}{messages}->[$length - 1]{mode} = $self->{FLOOD_IGNORE};
|
$self->message_history->{$account}{$channel}{messages}->[$length - 1]{mode} = $self->{FLOOD_IGNORE};
|
||||||
}
|
}
|
||||||
# check QUIT message for Ping timeout
|
# check QUIT message for Ping timeout or Excess Flood
|
||||||
elsif($text =~ /^QUIT Ping timeout/) {
|
elsif($text =~ /^QUIT Ping timeout/ or $text =~ /^QUIT Excess Flood/) {
|
||||||
# deal with ping timeouts agressively
|
# deal with these aggressively
|
||||||
${ $self->message_history }{$account}{$channel}{join_watch}++;
|
#${ $self->message_history }{$account}{$channel}{join_watch}++;
|
||||||
$self->{pbot}->logger->log("$account $channel joinwatch adjusted: ${ $self->message_history }{$account}{$channel}{join_watch}\n");
|
#$self->{pbot}->logger->log("$account $channel joinwatch adjusted: ${ $self->message_history }{$account}{$channel}{join_watch}\n");
|
||||||
} else {
|
} else {
|
||||||
# some other type of QUIT or PART
|
# some other type of QUIT or PART
|
||||||
$self->message_history->{$account}{$channel}{messages}->[$length - 1]{mode} = $self->{FLOOD_IGNORE};
|
$self->message_history->{$account}{$channel}{messages}->[$length - 1]{mode} = $self->{FLOOD_IGNORE};
|
||||||
@ -333,18 +333,4 @@ sub address_to_mask {
|
|||||||
return $banmask;
|
return $banmask;
|
||||||
}
|
}
|
||||||
|
|
||||||
# based on Guy Malachi's code
|
|
||||||
sub generate_random_string {
|
|
||||||
my $length_of_randomstring = shift;
|
|
||||||
|
|
||||||
my @chars=('a'..'z','A'..'Z','0'..'9','_');
|
|
||||||
my $random_string;
|
|
||||||
|
|
||||||
foreach (1..$length_of_randomstring) {
|
|
||||||
$random_string .= $chars[rand @chars];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $random_string;
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
@ -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 => 240,
|
BUILD_REVISION => 241,
|
||||||
BUILD_DATE => "2011-01-19",
|
BUILD_DATE => "2011-01-21",
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user