aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-01-03 21:00:26 +1300
committerDavid Phillips <david@sighup.nz>2018-01-03 21:00:26 +1300
commit7cf64bea04e47930f75513740b597a3116161d35 (patch)
treedf4f589918ead4ab8794c6a807d25f2595dc056f
parentf16a784ddffd165e72cff2356bd74c6a8eb71a05 (diff)
downloadidalius-7cf64bea04e47930f75513740b597a3116161d35.tar.xz
Ignore ignored users in pm too, except admins
-rwxr-xr-xidalius.pl7
1 files changed, 6 insertions, 1 deletions
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+)$/;