diff options
author | Zoffix Znet <cpan@zoffix.com> | 2016-06-04 23:20:01 -0400 |
---|---|---|
committer | Zoffix Znet <cpan@zoffix.com> | 2016-06-04 23:20:01 -0400 |
commit | c56f8b4359f2730bb9e8bccd40bf2c9fa840f433 (patch) | |
tree | 24d2021ab2794647aad2f44d802be160edfc485d /lib/IRC/Client/Grammar | |
parent | 5a2196b2c8f2ac2eacb3ddaf40b3e75b9c38bb62 (diff) |
First working rewrite
Diffstat (limited to 'lib/IRC/Client/Grammar')
-rw-r--r-- | lib/IRC/Client/Grammar/Actions.pm6 | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/IRC/Client/Grammar/Actions.pm6 b/lib/IRC/Client/Grammar/Actions.pm6 index 6ebe33d..cf702f8 100644 --- a/lib/IRC/Client/Grammar/Actions.pm6 +++ b/lib/IRC/Client/Grammar/Actions.pm6 @@ -40,8 +40,8 @@ method message ($match) { irc => $!irc, nick => %args<who><nick>//'', server => $!server, + usermask => ~($match<prefix>//''), username => %args<who><user>//''; - .<usermask> = .<nick> ~ '!' ~ .<username> ~ '@' ~ .<host> given %msg-args; my $msg; given %msg-args<command> { @@ -53,11 +53,17 @@ method message ($match) { :channel( %args<params>[0] ), |%msg-args; } - when 'NOTICE' { $msg = msg-notice %args, %msg-args } - when 'MODE' { $msg = msg-mode %args, %msg-args } - when 'PING' { $msg = IRC::Client::Message::Ping.new: |%msg-args; } - when 'PRIVMSG' { $msg = msg-privmsg %args, %msg-args } - default { $msg = IRC::Client::Message::Unknown.new: |%msg-args } + when 'PART' { + $msg = IRC::Client::Message::Part.new: + :channel( %args<params>[0] ), + |%msg-args; + } + when 'NOTICE' { $msg = msg-notice %args, %msg-args } + when 'MODE' { $msg = msg-mode %args, %msg-args } + when 'PING' { $msg = IRC::Client::Message::Ping.new: |%msg-args } + when 'PRIVMSG' { $msg = msg-privmsg %args, %msg-args } + when 'QUIT' { $msg = IRC::Client::Message::Quit.new: |%msg-args } + default { $msg = IRC::Client::Message::Unknown.new: |%msg-args } } $match.make: $msg; |