diff options
author | Zoffix Znet <cpan@zoffix.com> | 2015-12-06 18:07:19 -0500 |
---|---|---|
committer | Zoffix Znet <cpan@zoffix.com> | 2015-12-06 18:07:19 -0500 |
commit | d2da9fcd250533bee5df17bd182648a8cea0d7b0 (patch) | |
tree | fca0431ce3639d5a2ac85a69c4fe9f05717be789 /lib/IRC/Grammar/Actions.pm6 | |
parent | ba793ec6d1d4c66300f40cbced25f9ffd23ec792 (diff) |
Prerelease
Diffstat (limited to 'lib/IRC/Grammar/Actions.pm6')
-rw-r--r-- | lib/IRC/Grammar/Actions.pm6 | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/IRC/Grammar/Actions.pm6 b/lib/IRC/Grammar/Actions.pm6 index 7093b99..74a8f11 100644 --- a/lib/IRC/Grammar/Actions.pm6 +++ b/lib/IRC/Grammar/Actions.pm6 @@ -3,12 +3,11 @@ method TOP ($/) { $/.make: $<message>>>.made } method message ($/) { my $pref = $/<prefix>; my %args = command => ~$/<command>; - if ( $pref<servername>.defined ) { - %args<who><host> = ~$pref<servername>; - } - else { - %args<who><nick user host> = $pref<nick user host>ยป.Str; + for qw/nick user host/ { + $pref{$_}.defined or next; + %args<who>{$_} = $pref{$_}.Str; } + %args<who><host> = ~$pref<servername> if $pref<servername>.defined; my $p = $/<params>; loop { |