From 41728783ed12915ba7fd663e1e1b92490977f490 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Wed, 4 Mar 2020 18:26:39 -0800 Subject: [PATCH] AntiFlood: fix private message ignorelist --- PBot/AntiFlood.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PBot/AntiFlood.pm b/PBot/AntiFlood.pm index d88831c9..0b0b09e9 100644 --- a/PBot/AntiFlood.pm +++ b/PBot/AntiFlood.pm @@ -415,8 +415,7 @@ sub check_flood { $self->{pbot}->{messagehistory}->{database}->update_channel_data($account, $chan, $chan_data); } else { # private message flood my $hostmask = $self->address_to_mask($host); - $hostmask =~ s/\*/.*/g; - next if exists $self->{pbot}->{ignorelist}->{ignore_list}->{".*!$user\@$hostmask"}->{$chan}; + next if $self->{pbot}->{ignorelist}->{ignorelist}->exists($chan, "*!$user\@$hostmask"); my $chan_data = $self->{pbot}->{messagehistory}->{database}->get_channel_data($account, $chan, 'offenses', 'last_offense'); $chan_data->{offenses}++; @@ -425,7 +424,8 @@ sub check_flood { my $length = $self->{pbot}->{registry}->get_array_value('antiflood', 'chat_flood_punishment', $chan_data->{offenses} - 1); - $self->{pbot}->{ignorelist}->add(".*!$user\@$hostmask", $chan, $length); + my $owner = $self->{pbot}->{registry}->get_value('irc', 'botnick'); + $self->{pbot}->{ignorelist}->add($chan, "*!$user\@$hostmask", $length, $owner); $length = duration($length); $self->{pbot}->{logger}->log("$nick msg flood offense " . $chan_data->{offenses} . " earned $length ignore\n"); $self->{pbot}->{conn}->privmsg($nick, "You have used too many commands in too short a time period, you have been ignored for $length.");