mirror of
https://github.com/pragma-/pbot.git
synced 2024-12-24 11:42:35 +01:00
No need to WHOIS on joins if extended-join is available
This commit is contained in:
parent
ca349804ca
commit
d07458425f
@ -270,7 +270,7 @@ sub update_join_watch {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
# check QUIT message for Ping timeout or Excess Flood
|
# 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
|
# treat these as an extra join so they're snagged more quickly since these usually will keep flooding
|
||||||
$channel_data->{join_watch}++;
|
$channel_data->{join_watch}++;
|
||||||
$self->{pbot}->{messagehistory}->{database}->update_channel_data($account, $channel, $channel_data);
|
$self->{pbot}->{messagehistory}->{database}->update_channel_data($account, $channel, $channel_data);
|
||||||
@ -408,6 +408,9 @@ sub check_flood {
|
|||||||
$self->{pbot}->{conn}->whois($nick);
|
$self->{pbot}->{conn}->whois($nick);
|
||||||
$self->{whois_pending}->{$nick} = gettimeofday;
|
$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 {
|
} else {
|
||||||
if (not exists $self->{whois_pending}->{$nick}) {
|
if (not exists $self->{whois_pending}->{$nick}) {
|
||||||
$self->{pbot}->{messagehistory}->{database}->set_current_nickserv_account($account, '');
|
$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
|
# do not do flood enforcement for this event if bot is lagging
|
||||||
if($self->{pbot}->{lagchecker}->lagging) {
|
if($self->{pbot}->{lagchecker}->lagging) {
|
||||||
@ -746,10 +750,10 @@ sub check_bans {
|
|||||||
|
|
||||||
my $debug_checkban = $self->{pbot}->{registry}->get_value('antiflood', 'debug_checkban');
|
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);
|
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) {
|
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;
|
$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');
|
my $channel_data = $self->{pbot}->{messagehistory}->{database}->get_channel_data($message_account, $channel, 'validated');
|
||||||
|
Loading…
Reference in New Issue
Block a user