aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2018-09-11 22:53:35 +1200
committerDavid Phillips <david@sighup.nz>2018-09-11 22:53:35 +1200
commit45e19c655dbc5edd733d574b53384ffcc8655d78 (patch)
tree95a30c73aa92cf2f17859c6e7db38c2a79d1cd93
parent5722960a0d54c5939ee11d6cf166198e4b40a284 (diff)
downloadidalius-45e19c655dbc5edd733d574b53384ffcc8655d78.tar.xz
Map: Allow currying, fix bug with comma parsing
-rw-r--r--Plugin/Map.pm4
-rw-r--r--TODO1
2 files changed, 2 insertions, 3 deletions
diff --git a/Plugin/Map.pm b/Plugin/Map.pm
index fb37e64..665f41f 100644
--- a/Plugin/Map.pm
+++ b/Plugin/Map.pm
@@ -46,7 +46,7 @@ sub parse_list {
$nest--;
}
- if ($c eq "," || ($nest == 0 and $c eq "]")) {
+ if (($nest == 1 and $c eq ",") || ($nest == 0 and $c eq "]")) {
my $item = substr($input, $item_i, $i - $item_i);
$item =~ s/^\s+|\s+$//g;
push @res, $item;
@@ -66,7 +66,7 @@ sub parse_list {
sub map {
my ($self, $irc, $logger, $who, $where, $rest, @arguments) = @_;
- my ($command, $subjects_raw) = ($rest =~ /^(.+?)\s+(.*)$/);
+ my ($command, $subjects_raw) = ($rest =~ /^(.+)\s+(\[.*\])$/);
return "Syntax: map command [item1, item2, ...]" unless $command and $subjects_raw;
diff --git a/TODO b/TODO
index 74b0cb7..a986fc8 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,3 @@
-* add currying support to Map.pm
* add section to config file for each module
+ allow whitelisting and blacklisting under each module, per-channel
e.g. "use url_title everywhere except channel ##bar where a bot already