From b8f67601e0086d7a2403e4f47ca720e3df3c5365 Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Mon, 17 Dec 2018 06:22:24 +0100
Subject: Make auto-prefixing nicks optional
This patch adds the :autoprefix option, which is True by default. When set to
False, the .reply method should no longer prefix the message with the triggering
user's nick.
---
lib/IRC/Client.pm6 | 4 ++++
1 file changed, 4 insertions(+)
(limited to 'lib/IRC/Client.pm6')
diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6
index cd2348e..f0bc7a8 100644
--- a/lib/IRC/Client.pm6
+++ b/lib/IRC/Client.pm6
@@ -21,6 +21,7 @@ has $.debug;
has Lock $!lock = Lock.new;
has Channel $!event-pipe = Channel.new;
has Channel $!socket-pipe = Channel.new;
+has Bool $.autoprefix = True;
my &colored = (try require Terminal::ANSIColor) === Nil
&& sub (Str $s, $) { $s } ||
@@ -44,9 +45,12 @@ submethod BUILD (
Str:D :$userhost = 'localhost',
Str:D :$userreal = 'Perl6 IRC Client',
:$channels = ('#perl6',),
+ Bool:D :$autoprefix = True,
) {
@!filters = @$filters;
@!plugins = @$plugins;
+ $!autoprefix = $autoprefix;
+
my %servers = %$servers;
my %all-conf = :$port, :$password, :$host, :$nick, :$alias,
--
cgit v1.1