aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-01-03 20:51:28 +1300
committerDavid Phillips <david@sighup.nz>2018-01-03 20:51:28 +1300
commitf16a784ddffd165e72cff2356bd74c6a8eb71a05 (patch)
tree2b98d7dc377234bb2b8fe340fe225625a3749fb9
parentafe5fc41fa45b4fbc2b12103f7e8bbb4e1dc706a (diff)
downloadidalius-f16a784ddffd165e72cff2356bd74c6a8eb71a05.tar.xz
Add on-the-fly ignore/unignore commands
-rwxr-xr-xidalius.pl22
1 files changed, 22 insertions, 0 deletions
diff --git a/idalius.pl b/idalius.pl
index 85fad47..5c13c24 100755
--- a/idalius.pl
+++ b/idalius.pl
@@ -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) {