3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 19:22:40 +01:00

No need to WHOIS on joins if extended-join is available

This commit is contained in:
Pragmatic Software 2016-08-29 20:47:46 -07:00
parent ca349804ca
commit d07458425f

View File

@ -270,7 +270,7 @@ sub update_join_watch {
}
}
# check QUIT message for Ping timeout or Excess Flood
elsif($text =~ /^QUIT Ping timeout/ or $text =~ /^QUIT Excess Flood/) {
elsif($text =~ /^QUIT Ping timeout/ or $text =~ /^QUIT Excess Flood/ or $text =~ /^QUIT Max SendQ exceeded/) {
# treat these as an extra join so they're snagged more quickly since these usually will keep flooding
$channel_data->{join_watch}++;
$self->{pbot}->{messagehistory}->{database}->update_channel_data($account, $channel, $channel_data);
@ -408,6 +408,9 @@ sub check_flood {
$self->{pbot}->{conn}->whois($nick);
$self->{whois_pending}->{$nick} = gettimeofday;
}
} else {
if ($mode == $self->{pbot}->{messagehistory}->{MSG_JOIN} && exists $self->{pbot}->{capabilities}->{'extended-join'}) {
# don't WHOIS joins if extended-join capability is active
} else {
if (not exists $self->{whois_pending}->{$nick}) {
$self->{pbot}->{messagehistory}->{database}->set_current_nickserv_account($account, '');
@ -417,6 +420,7 @@ sub check_flood {
}
}
}
}
# do not do flood enforcement for this event if bot is lagging
if($self->{pbot}->{lagchecker}->lagging) {
@ -746,10 +750,10 @@ sub check_bans {
my $debug_checkban = $self->{pbot}->{registry}->get_value('antiflood', 'debug_checkban');
$self->{pbot}->{logger}->log("anti-flood: [check-bans] checking for bans on $mask in $channel\n") if $debug_checkban >= 1;
my $current_nickserv_account = $self->{pbot}->{messagehistory}->{database}->get_current_nickserv_account($message_account);
$self->{pbot}->{logger}->log("anti-flood: [check-bans] checking for bans on $mask " . (defined $current_nickserv_account and length $current_nickserv_account ? "[$current_nickserv_account] " : "") . "in $channel\n");
if (defined $current_nickserv_account and length $current_nickserv_account) {
$self->{pbot}->{logger}->log("anti-flood: [check-bans] current nickserv [$current_nickserv_account] found for $mask\n") if $debug_checkban >= 2;
my $channel_data = $self->{pbot}->{messagehistory}->{database}->get_channel_data($message_account, $channel, 'validated');