From 6b544e9bf42c03b7659b55005b4b0a34f9e86279 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 20 Jun 2015 17:48:42 -0700 Subject: [PATCH] Stop processing ban evasions immediately after first ban is detected --- PBot/AntiFlood.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PBot/AntiFlood.pm b/PBot/AntiFlood.pm index 5da77287..43c25dbb 100644 --- a/PBot/AntiFlood.pm +++ b/PBot/AntiFlood.pm @@ -647,12 +647,13 @@ sub check_bans { $self->{pbot}->{logger}->log("anti-flood: [check-bans] Hostmask ($mask [$alias" . (defined $nickserv ? "/$nickserv" : "") . "]) matches $baninfo->{type} $baninfo->{banmask}, adding ban\n"); push @$bans, $baninfo; - last; + goto GOT_BAN; } } } } + GOT_BAN: if(defined $bans) { foreach my $baninfo (@$bans) { my $banmask; @@ -757,7 +758,9 @@ sub on_whoisaccount { my $nick = $event->{event}->{args}[1]; my $account = lc $event->{event}->{args}[2]; - $self->{pbot}->{logger}->log("$nick is using NickServ account [$account]\n"); + if ($self->{pbot}->{registry}->get_value('antiflood', 'debug_checkban')) { + $self->{pbot}->{logger}->log("$nick is using NickServ account [$account]\n"); + } my ($id, $hostmask) = $self->{pbot}->{messagehistory}->{database}->find_message_account_by_nick($nick); # $self->{pbot}->{logger}->log("whoisaccount: Found [$id][$hostmask][$account] for [$nick]\n");