diff options
author | Aleks-Daniel Jakimenko-Aleksejev <alex.jakimenko@gmail.com> | 2019-04-12 18:08:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-12 18:08:15 +0300 |
commit | 7d060c7983a0d8e5d5092dc7d88d5f1b8a7577a7 (patch) | |
tree | 2c18ce8a3bc3f84d51d3351c6b7fe3abd1eda951 /lib/IRC/Client | |
parent | 590379beaaf8fbf525c9f14d0f34116ed20f6ea3 (diff) | |
parent | b8f67601e0086d7a2403e4f47ca720e3df3c5365 (diff) |
Merge pull request #61 from Tyil/reply-no-prefix
Add an option to not automatically prefix replies with a user's nick
Diffstat (limited to 'lib/IRC/Client')
-rw-r--r-- | lib/IRC/Client/Message.pm6 | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/IRC/Client/Message.pm6 b/lib/IRC/Client/Message.pm6 index 79ef7d8..ff307ef 100644 --- a/lib/IRC/Client/Message.pm6 +++ b/lib/IRC/Client/Message.pm6 @@ -40,8 +40,10 @@ role Privmsg does M { role Privmsg::Channel does Privmsg { has $.channel; method reply ($text, :$where) { - $.irc.send-cmd: 'PRIVMSG', $where // $.channel, $text, - :$.server, :prefix("$.nick, "); + $.irc.autoprefix + ?? $.irc.send-cmd: 'PRIVMSG', $where // $.channel, $text, :$.server, :prefix("$.nick, ") + !! $.irc.send-cmd: 'PRIVMSG', $where // $.channel, $text, :$.server + ; } } role Privmsg::Me does Privmsg { @@ -60,8 +62,11 @@ role Notice does M { role Notice::Channel does Notice { has $.channel; method reply ($text, :$where) { - $.irc.send-cmd: 'NOTICE', $where // $.channel, $text, - :$.server, :prefix("$.nick, "); + $.irc.autoprefix + ?? $.irc.send-cmd: 'NOTICE', $where // $.channel, $text, :$.server, :prefix("$.nick, ") + !! $.irc.send-cmd: 'NOTICE', $where // $.channel, $text, :$.server + ; + $.replied = True; } } |