summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarDoug Freed <dwfreed@mtu.edu>2015-03-01 05:13:28 +0400
committerLibravatarJanik Kleinhoff <janik@kleinhoff.de>2015-03-01 05:13:28 +0400
commite3dea4bdbcd3526e1cc084f102e663252daf6807 (patch)
tree006b56c6b57dd7eb9f27c540df6d1d4b1f8620b6
parent4fc0df97f75404d7e482be7cd82ba54bcce39f49 (diff)
Let admins check the state of the monitor flag
-rw-r--r--config-default/commands.xml15
1 files changed, 10 insertions, 5 deletions
diff --git a/config-default/commands.xml b/config-default/commands.xml
index 06243a2..2551867 100644
--- a/config-default/commands.xml
+++ b/config-default/commands.xml
@@ -125,18 +125,23 @@
$::db->raw($conn, $event->{to}->[0], $dbh, $2);
]]>
</command>
- <command cmd="^;monitor (\S+) (yes|no)$" flag="a">
+ <command cmd="^;monitor (\S+) ?(yes|no)?$" flag="a">
<![CDATA[
my $chan = lc $1;
- my $switch = lc $2;
my $link = ASM::Util->getLink(lc $chan);
if ( lc $link ne lc $chan ) {
$conn->privmsg($event->replyto, "Error: $chan is linked to $link - use $link instead.");
return;
}
- $::channels->{channel}->{$chan}->{monitor} = $switch;
- ASM::XML->writeChannels();
- $conn->privmsg($event->replyto, "Monitor flag for $chan set to $switch");
+ if (defined($2)) {
+ my $switch = lc $2;
+ $::channels->{channel}->{$chan}->{monitor} = $switch;
+ ASM::XML->writeChannels();
+ $conn->privmsg($event->replyto, "Monitor flag for $chan set to $switch");
+ } else {
+ my $switch = $::channels->{channel}->{$chan}->{monitor};
+ $conn->privmsg($event->replyto, "Monitor flag for $chan is currently set to $switch");
+ }
]]>
</command>
<command cmd="^;help$">