From ed6c6f01bd563df1c4f7ec1a7e6262bffb6c24cc Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Tue, 2 Aug 2016 10:13:51 -0400 Subject: Add support for channel passwords Closes #18 --- lib/IRC/Client.pm6 | 3 ++- lib/IRC/Client/Server.pm6 | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/IRC/Client.pm6 b/lib/IRC/Client.pm6 index f2f73a7..486bfcd 100644 --- a/lib/IRC/Client.pm6 +++ b/lib/IRC/Client.pm6 @@ -75,7 +75,8 @@ submethod BUILD ( } method join (*@channels, :$server) { - self.send-cmd: 'JOIN', $_, :$server for @channels; + self.send-cmd: 'JOIN', ($_ ~~ Pair ?? .kv !! .Str), :$server + for @channels; self; } diff --git a/lib/IRC/Client/Server.pm6 b/lib/IRC/Client/Server.pm6 index 1857fcc..f438d6d 100644 --- a/lib/IRC/Client/Server.pm6 +++ b/lib/IRC/Client/Server.pm6 @@ -1,6 +1,6 @@ unit class IRC::Client::Server; -has @.channels where .all ~~ Str; +has @.channels where .all ~~ Str|Pair; has @.nick where .all ~~ Str; has Int $.port where 0 <= $_ <= 65535; has Str $.label; -- cgit v1.1