diff options
author | David Phillips <david@sighup.nz> | 2018-01-03 20:51:28 +1300 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2018-01-03 20:51:28 +1300 |
commit | f16a784ddffd165e72cff2356bd74c6a8eb71a05 (patch) | |
tree | 2b98d7dc377234bb2b8fe340fe225625a3749fb9 | |
parent | afe5fc41fa45b4fbc2b12103f7e8bbb4e1dc706a (diff) | |
download | idalius-f16a784ddffd165e72cff2356bd74c6a8eb71a05.tar.xz |
Add on-the-fly ignore/unignore commands
-rwxr-xr-x | idalius.pl | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -174,6 +174,28 @@ sub irc_msg { $irc->yield(privmsg => $nick => "Syntax: nick <nick>"); } } + if ($what =~ /^ignore\s/) { + my ($target) = $what =~ /^ignore\s+(\S+)$/; + if ($target) { + push @{$config{ignore}}, $target; + $irc->yield(privmsg => $nick => "Ignoring $target."); + } else { + $irc->yield(privmsg => $nick => "Syntax: ignore <nick>"); + } + } + if ($what =~ /^don't ignore\s/) { + my ($target) = $what =~ /^don't ignore\s+(\S+)$/; + if ($target) { + if (grep { $_ eq $target} @{$config{ignore}}) { + @{$config{ignore}} = grep { $_ ne $target } @{$config{ignore}}; + $irc->yield(privmsg => $nick => "No longer ignoring $target."); + } else { + $irc->yield(privmsg => $nick => "I wasn't ignoring $target anyway."); + } + } else { + $irc->yield(privmsg => $nick => "Syntax: don't ignore <nick>"); + } + } if ($what =~ /^part\s/) { my $message; if ($what =~ /^part(\s+(\S+))+$/m) { |