From 7cf64bea04e47930f75513740b597a3116161d35 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 3 Jan 2018 21:00:26 +1300 Subject: Ignore ignored users in pm too, except admins --- idalius.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/idalius.pl b/idalius.pl index 5c13c24..45354e8 100755 --- a/idalius.pl +++ b/idalius.pl @@ -159,11 +159,16 @@ sub irc_public { sub irc_msg { my ($who, $to, $what, $ided) = @_[ARG0 .. ARG3]; my $nick = (split /!/, $who)[0]; + my $is_admin = grep {$_ eq $who} @{$config{admins}}; + + # reject ignored nicks who aren't also admins (prevent lockout) + return if (grep {$_ eq $nick} @{$config{ignore}} and not $is_admin); + if ($config{must_id} && $ided != 1) { $irc->yield(privmsg => $nick => "You must identify with services"); return; } - return unless grep {$_ eq $who} @{$config{admins}}; + return unless $is_admin; # FIXME this needs tidying. Some of this can be factored out, surely. if ($what =~ /^nick\s/) { my ($newnick) = $what =~ /^nick\s+(\S+)$/; -- cgit v1.1