From 68821bb0f806558f6e983d0ec4290daf677ffb1c Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 3 Aug 2017 15:21:46 -0700 Subject: [PATCH] BlackList now respects channel for $a: and $r: --- PBot/BlackList.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PBot/BlackList.pm b/PBot/BlackList.pm index 7991a764..ceef5b28 100644 --- a/PBot/BlackList.pm +++ b/PBot/BlackList.pm @@ -147,13 +147,15 @@ sub check_blacklist { $black_channel_escaped =~ s/\\(\.|\*)/$1/g; $black_hostmask_escaped =~ s/\\(\.|\*)/$1/g; + next if $channel !~ /^$black_channel_escaped$/; + if ($flag eq 'a' && defined $nickserv && $nickserv =~ /$black_hostmask_escaped/i) { $self->{pbot}->{logger}->log("$hostmask nickserv $nickserv blacklisted in channel $channel (matches [\$a:$black_hostmask] host and [$black_channel] channel)\n"); return 1; } elsif ($flag eq 'r' && defined $gecos && $gecos =~ /$black_hostmask_escaped/i) { $self->{pbot}->{logger}->log("$hostmask GECOS $gecos blacklisted in channel $channel (matches [\$r:$black_hostmask] host and [$black_channel] channel)\n"); return 1; - } elsif ($flag eq '' && $channel =~ /^$black_channel_escaped$/i && $hostmask =~ /$black_hostmask_escaped/i) { + } elsif ($flag eq '' && $hostmask =~ /$black_hostmask_escaped/i) { $self->{pbot}->{logger}->log("$hostmask blacklisted in channel $channel (matches [$black_hostmask] host and [$black_channel] channel)\n"); return 1; }