From c97eb34b64788602713fcc77d3c18ab17b629318 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Mon, 21 Dec 2015 09:10:03 -0500 Subject: Some docs --- lib/IRC/Client.pm6 | 16 ++++++++-------- lib/IRC/Client/Plugin/Debugger.pm6 | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index 7b1c7e5..c781ef1 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -34,10 +34,15 @@ class IRC::Client:ver<1.002001> { EVENTS: for @$events -> $e { $e = {}; + for @!plugs.grep(*.^can: 'irc-all-events') -> $p { + my $res = $p.all-events(self, $e); + next EVENTS unless $res === IRC_NOT_HANDLED; + } + if ( $e eq 'PRIVMSG' and $e[0] eq $!nick ) { - for @!plugs.grep(*.^can: 'privmsg-me') -> $p { + for @!plugs.grep(*.^can: 'irc-privmsg-me') -> $p { my $res = $p.privmsg-me(self, $e); next EVENTS unless $res === IRC_NOT_HANDLED; } @@ -46,24 +51,19 @@ class IRC::Client:ver<1.002001> { if ( $e eq 'NOTICE' and $e[0] eq $!nick ) { - for @!plugs.grep(*.^can: 'notice-me') -> $p { + for @!plugs.grep(*.^can: 'irc-notice-me') -> $p { my $res = $p.notice-me(self, $e); next EVENTS 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; - } - my $cmd = 'irc-' ~ $e.lc; for @!plugs.grep(*.^can: $cmd) -> $p { my $res = $p."$cmd"(self, $e); next EVENTS unless $res === IRC_NOT_HANDLED; } - for @!plugs.grep(*.^can: 'unhandled') -> $p { + for @!plugs.grep(*.^can: 'irc-unhandled') -> $p { my $res = $p.unhandled(self, $e); next EVENTS unless $res === IRC_NOT_HANDLED; } diff --git a/lib/IRC/Client/Plugin/Debugger.pm6 b/lib/IRC/Client/Plugin/Debugger.pm6 index 17cf697..131bb35 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 all-events ($irc, $e) { +method irc-all-events ($irc, $e) { say Dump $e, :indent(4); return IRC_NOT_HANDLED; } -- cgit v1.1