aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZoffix Znet <cpan@zoffix.com>2016-07-26 08:53:29 -0400
committerZoffix Znet <cpan@zoffix.com>2016-07-26 08:53:29 -0400
commit226a5ccd074b8840ca83d50376f8b26b9d9ffd97 (patch)
tree7521357332940c246a3076ca27ea7625c02f8147 /lib
parentea2c4707a526cc9746ed929e7a38d932721db624 (diff)
More stuff
Diffstat (limited to 'lib')
-rw-r--r--lib/IRC/Client.pm66
-rw-r--r--lib/IRC/Client/Message.pm68
2 files changed, 6 insertions, 8 deletions
diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6
index 5069d31..9e3bfbd 100644
--- a/lib/IRC/Client.pm6
+++ b/lib/IRC/Client.pm6
@@ -93,17 +93,15 @@ method send (:$where!, :$text!, :$server, :$notice) {
}
}
-method send-cmd ($cmd, *@args is copy, :$server) {
+method send-cmd ($cmd, *@args is copy, :$server, :$prefix = '') {
CATCH { default { warn $_; warn .backtrace } }
- say "About to check filter stuff `{@!filters}`";
if $cmd eq 'NOTICE'|'PRIVMSG' and @!filters
and my @f = @!filters.grep({
.signature.ACCEPTS: \(@args[1])
or .signature.ACCEPTS: \(@args[1], where => @args[0])
})
{
- say "Starting filtering: `@f[]`";
start {
CATCH { default { warn $_; warn .backtrace } }
@@ -114,7 +112,7 @@ method send-cmd ($cmd, *@args is copy, :$server) {
when 2 { ($text, $where) = $f($text, :$where) }
}
}
- self!ssay: :$server, join ' ', $cmd, $where, ":$text";
+ self!ssay: :$server, join ' ', $cmd, $where, ":$prefix$text";
}
}
else {
diff --git a/lib/IRC/Client/Message.pm6 b/lib/IRC/Client/Message.pm6
index 84eba2c..9559fd1 100644
--- a/lib/IRC/Client/Message.pm6
+++ b/lib/IRC/Client/Message.pm6
@@ -39,8 +39,8 @@ role Privmsg does M {
role Privmsg::Channel does Privmsg {
has $.channel;
method reply ($text, :$where) {
- $.irc.send-cmd: 'PRIVMSG', $where // $.channel, "$.nick, $text",
- :$.server;
+ $.irc.send-cmd: 'PRIVMSG', $where // $.channel, $text,
+ :$.server, :prefix("$.nick, ");
}
}
role Privmsg::Me does Privmsg {
@@ -57,8 +57,8 @@ role Notice does M {
role Notice::Channel does Notice {
has $.channel;
method reply ($text, :$where) {
- $.irc.send-cmd: 'NOTICE', $where // $.channel, "$.nick, $text",
- :$.server;
+ $.irc.send-cmd: 'NOTICE', $where // $.channel, $text,
+ :$.server, :prefix("$.nick, ");
$.replied = True;
}
}