From 60480737736e85d8e324115e29fb9a82052274bc Mon Sep 17 00:00:00 2001 From: Doug Freed Date: Fri, 5 Feb 2016 21:13:44 -0700 Subject: Don't allow double suppression. It breaks things. --- lib/ASM/Commander.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/ASM/Commander.pm b/lib/ASM/Commander.pm index dee2633..b64103a 100644 --- a/lib/ASM/Commander.pm +++ b/lib/ASM/Commander.pm @@ -373,6 +373,10 @@ sub cmd_suppress { my $chan = lc $1; my $old = $::channels->{channel}->{$chan}->{monitor}; + if ($old eq 'no') { + $conn->privmsg($event->replyto, "$chan is not currently monitored"); + return; + } $::channels->{channel}->{$chan}->{monitor} = "no"; $conn->schedule(30*60, sub { $::channels->{channel}->{$chan}->{monitor} = $old; -- cgit v1.2.3