aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZoffix Znet <cpan@zoffix.com>2016-10-15 14:45:23 -0400
committerZoffix Znet <cpan@zoffix.com>2016-10-15 14:45:23 -0400
commit4411e6f5498beec81c95eb9810c37cd7ab56a0db (patch)
treeac86576b4d0b80e3a7df4faa1507a55fb5b88fa2 /lib
parentacd52a7219f7518355fe8e1216ea5faf3ff18bf7 (diff)
Fix numeric events being unsubscrabable due to incorrect identifiers
Fixes #31
Diffstat (limited to 'lib')
-rw-r--r--lib/IRC/Client.pm65
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6
index 3879ac9..e5696b4 100644
--- a/lib/IRC/Client.pm6
+++ b/lib/IRC/Client.pm6
@@ -267,7 +267,10 @@ method !handle-event ($e) {
$s.is-connected = True;
take 'irc-connected';
}
- take 'irc-' ~ $e.command, $event-name;
+
+ # prefix numerics with 'n' as irc-\d+ isn't a valid identifier
+ take 'irc-' ~ ('n' if $e ~~ IRC::Client::Message::Numeric)
+ ~ $e.command, $event-name;
}
default { take $event-name }
}