diff options
author | Zoffix Znet <cpan@zoffix.com> | 2016-07-29 19:16:49 -0400 |
---|---|---|
committer | Zoffix Znet <cpan@zoffix.com> | 2016-07-29 19:16:49 -0400 |
commit | db4b16e06ee14205a988263942524e1d754f8f64 (patch) | |
tree | 09d6ec0b5e3df44520f17a523f8c534109d16a70 /lib/IRC | |
parent | 3db4922a3cd722763f0658b72886d4e0970a2913 (diff) |
Fix filters with Promises
Diffstat (limited to 'lib/IRC')
-rw-r--r-- | lib/IRC/Client.pm6 | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index 6b442da..cd23b73 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -272,7 +272,10 @@ method !handle-event ($e) { last EVENT if $res ~~ IRC::Client | Supply | Channel; if $res ~~ Promise { - $res.then: { $e.?reply: $^r unless $^r ~~ Nil or $e.?replied; } + $res.then: { + $e.?reply: $^r.result + unless $^r.result ~~ Nil or $e.?replied; + } } else { $e.?reply: $res unless $res ~~ Nil or $e.?replied; } @@ -318,8 +321,8 @@ method send-cmd ($cmd, *@args is copy, :$prefix = '', :$server) { CATCH { default { warn $_; warn .backtrace } } for @f -> $f { given $f.signature.params.elems { - when 1 { $text = $f($text); } - when 2 { ($text, $where) = $f($text, :$where) } + when 1 { $text = $f($text); } + when 2 { ($text, $where) = $f($text, :$where); } } } self!ssay: :$server, join ' ', $cmd, $where, ":$prefix$text"; |