From 8a69b2bf6d9a63e24eb5d29d2a6f86d15ea14793 Mon Sep 17 00:00:00 2001 From: William Heimbigner Date: Wed, 13 Jan 2016 17:17:24 -0700 Subject: Use named capture groups for the restrict function --- config-default/commands.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/config-default/commands.xml b/config-default/commands.xml index b8e9d22..299d599 100644 --- a/config-default/commands.xml +++ b/config-default/commands.xml @@ -578,19 +578,19 @@ $conn->privmsg($event->replyto, 'config files were re-read'); ]]> - + {$type . 's'}->{$type}->{$who}->{$restriction}; - $conn->privmsg($event->replyto, "Removed $restriction restriction for $type $who"); + my $who = lc $+{who}; + if ($+{mode} eq '-') { + delete $::restrictions->{$+{type} . 's'}->{$+{type}}->{$who}->{$+{restriction}}; + $conn->privmsg($event->replyto, "Removed $+{restriction} restriction for $+{type} $who"); } - if ($mode eq '+') { - if (! defined($::restrictions->{$type . 's'}->{$type}->{$who})) { - $::restrictions->{$type . 's'}->{$type}->{$who} = {}; + if ($+{mode} eq '+') { + if (! defined($::restrictions->{$+{type} . 's'}->{$+{type}}->{$who})) { + $::restrictions->{$+{type} . 's'}->{$+{type}}->{$who} = {}; } - $::restrictions->{$type . 's'}->{$type}->{$who}->{$restriction} = $restriction; - $conn->privmsg($event->replyto, "Added $restriction restriction for $type $who"); + $::restrictions->{$+{type} . 's'}->{$+{type}}->{$who}->{$+{restriction}} = $+{restriction}; + $conn->privmsg($event->replyto, "Added $+{restriction} restriction for $+{type} $who"); } ASM::XML->writeRestrictions(); ]]> -- cgit v1.2.3