aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZoffix Znet <cpan@zoffix.com>2015-12-13 19:14:23 -0500
committerZoffix Znet <cpan@zoffix.com>2015-12-13 19:14:23 -0500
commit05647bd1f2312cc756f71152252a6349e86f43c5 (patch)
tree68e2238ed3ec868de1316f21ef1df2d1ea367831 /lib
parent22e34475c8fe5d6957525962adb4f65d910e46d0 (diff)
update docs
Diffstat (limited to 'lib')
-rw-r--r--lib/IRC/Client.pm634
-rw-r--r--lib/IRC/Client/Plugin.pm61
-rw-r--r--lib/IRC/Client/Plugin/Debugger.pm64
-rw-r--r--lib/IRC/Client/Plugin/PingPong.pm62
4 files changed, 20 insertions, 21 deletions
diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6
index c8e6ac4..2623dc2 100644
--- a/lib/IRC/Client.pm6
+++ b/lib/IRC/Client.pm6
@@ -30,37 +30,37 @@ class IRC::Client:ver<1.002001> {
react {
whenever $!sock.Supply -> $str is copy {
$!debug and "[server {DateTime.now}] {$str}".put;
- my $messages = parse-irc $str;
- MESSAGES: for @$messages -> $message {
- $message<pipe> = {};
+ my $event = parse-irc $str;
+ EVENTS: for @$events -> $e {
+ $e<pipe> = {};
- if ( $message<command> eq 'PRIVMSG'
- and $message<params>[0] eq $!nick
+ if ( $e<command> eq 'PRIVMSG'
+ and $e<params>[0] eq $!nick
) {
for @!plugs.grep(*.^can: 'privmsg-me') -> $p {
- my $res = $p.privmsg-me(self, $message);
- next MESSAGES unless $res === IRC_NOT_HANDLED;
+ my $res = $p.privmsg-me(self, $e);
+ next EVENTS unless $res === IRC_NOT_HANDLED;
}
}
- if ( $message<command> eq 'NOTICE'
- and $message<params>[0] eq $!nick
+ if ( $e<command> eq 'NOTICE'
+ and $e<params>[0] eq $!nick
) {
for @!plugs.grep(*.^can: 'notice-me') -> $p {
- my $res = $p.notice-me(self, $message);
- next MESSAGES unless $res === IRC_NOT_HANDLED;
+ my $res = $p.notice-me(self, $e);
+ next EVENTS unless $res === IRC_NOT_HANDLED;
}
}
- my $cmd = 'irc-' ~ $message<command>.lc;
+ my $cmd = 'irc-' ~ $e<command>.lc;
for @!plugs.grep(*.^can: $cmd) -> $p {
- my $res = $p."$cmd"(self, $message);
- next MESSAGES unless $res === IRC_NOT_HANDLED;
+ my $res = $p."$cmd"(self, $e);
+ next EVENTS unless $res === IRC_NOT_HANDLED;
}
- for @!plugs.grep(*.^can: 'msg') -> $p {
- my $res = $p.msg(self, $message);
- next MESSAGES unless $res === IRC_NOT_HANDLED;
+ for @!plugs.grep(*.^can: 'all-events') -> $p {
+ my $res = $p.all-events(self, $e);
+ next EVENTS unless $res === IRC_NOT_HANDLED;
}
}
}
diff --git a/lib/IRC/Client/Plugin.pm6 b/lib/IRC/Client/Plugin.pm6
index eda7a0a..55db82c 100644
--- a/lib/IRC/Client/Plugin.pm6
+++ b/lib/IRC/Client/Plugin.pm6
@@ -1,5 +1,4 @@
constant IRC_HANDLED = "irc plugin handled \x1";
constant IRC_NOT_HANDLED = "irc plugin not-handled \x2";
unit class IRC::Client::Plugin:ver<1.002002>;
-has $.irc;
diff --git a/lib/IRC/Client/Plugin/Debugger.pm6 b/lib/IRC/Client/Plugin/Debugger.pm6
index 4ded968..17cf697 100644
--- a/lib/IRC/Client/Plugin/Debugger.pm6
+++ b/lib/IRC/Client/Plugin/Debugger.pm6
@@ -2,7 +2,7 @@ use Data::Dump;
use IRC::Client::Plugin;
unit class IRC::Client::Plugin::Debugger:ver<1.002001> is IRC::Client::Plugin;
-method msg ($irc, $msg) {
- say Dump $msg, :indent(4);
+method all-events ($irc, $e) {
+ say Dump $e, :indent(4);
return IRC_NOT_HANDLED;
}
diff --git a/lib/IRC/Client/Plugin/PingPong.pm6 b/lib/IRC/Client/Plugin/PingPong.pm6
index a85dc96..d6b8f28 100644
--- a/lib/IRC/Client/Plugin/PingPong.pm6
+++ b/lib/IRC/Client/Plugin/PingPong.pm6
@@ -1,2 +1,2 @@
unit class IRC::Client::Plugin::PingPong:ver<1.002001>;
-method irc-ping ($irc, $msg) { $irc.ssay("PONG {$irc.nick} $msg<params>[0]") }
+method irc-ping ($irc, $e) { $irc.ssay("PONG {$irc.nick} $e<params>[0]") }