From 9f265a0f0eb27afcf4524f727be2ea09a9befcb3 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sun, 15 Feb 2015 20:16:37 -0800 Subject: [PATCH] Do not enforce anti-flood on logged in bot admins --- PBot/AntiFlood.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PBot/AntiFlood.pm b/PBot/AntiFlood.pm index f826be4b..8649c139 100644 --- a/PBot/AntiFlood.pm +++ b/PBot/AntiFlood.pm @@ -274,6 +274,9 @@ sub check_flood { return; } + # do not do flood enforcement for logged in bot admins + return if $self->{pbot}->{admins}->loggedin($channel, "$nick!$user\@$host"); + # check for enter abuse if($mode == $self->{pbot}->{messagehistory}->{MSG_CHAT} and $channel =~ m/^#/) { my $channel_data = $self->{pbot}->{messagehistory}->{database}->get_channel_data($account, $channel, 'enter_abuse', 'enter_abuses', 'offenses'); @@ -352,7 +355,7 @@ sub check_flood { #$self->{pbot}->{logger}->log("last: [$last->{timestamp}] $last->{msg}\n"); #$self->{pbot}->{logger}->log("Comparing message timestamps $last->{timestamp} - $msg->{timestamp} = " . ($last->{timestamp} - $msg->{timestamp}) . " against max_time $max_time\n"); - if($last->{timestamp} - $msg->{timestamp} <= $max_time && not $self->{pbot}->{admins}->loggedin($channel, "$nick!$user\@$host")) { + if ($last->{timestamp} - $msg->{timestamp} <= $max_time) { if($mode == $self->{pbot}->{messagehistory}->{MSG_JOIN}) { my $channel_data = $self->{pbot}->{messagehistory}->{database}->get_channel_data($account, $channel, 'offenses', 'last_offense', 'join_watch'); #$self->{pbot}->{logger}->log("$account offenses $channel_data->{offenses}, join watch $channel_data->{join_watch}, max messages $max_messages\n");