diff options
author | Zoffix Znet <cpan@zoffix.com> | 2016-08-02 09:25:58 -0400 |
---|---|---|
committer | Zoffix Znet <cpan@zoffix.com> | 2016-08-02 09:25:58 -0400 |
commit | 2631fd549acd296648c4c7b919dbce3e834873a9 (patch) | |
tree | a207d33586aa228cd87d1b266224658d633ce31e /lib/IRC | |
parent | 6040f31ed938c48b5179633ffafd7becd2c546bd (diff) |
Fix missing user/channel info in debug output for PRIVMSG/NOTICE messages
Diffstat (limited to 'lib/IRC')
-rw-r--r-- | lib/IRC/Client.pm6 | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index 4ec67a5..1b616ce 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -370,11 +370,16 @@ method !ssay (Str:D $msg, :$server is copy) { ############################################################################### ############################################################################### -sub debug-print (Str() $str, :$in, :$out, :$sys, :$server) { +sub debug-print ($str, :$in, :$out, :$sys, :$server) { my $server-str = $server ?? colored(~$server, 'bold white on_cyan') ~ ' ' !! ''; - my @bits = $str.split: ' '; + my @bits = ( + $str ~~ IRC::Client::Message::Privmsg|IRC::Client::Message::Notice + ?? ":$str.usermask() $str.command() $str.args()[]" + !! $str.Str + ).split: ' '; + if $in { my ($pref, $cmd) = 0, 1; if @bits[0] eq '❚⚠❚' { |