~sircmpwn/ChatSharp

68822768ca9f11f7414352ea405dfa90774d44fd — Drew DeVault 5 years ago d1424ba + f380779
Merge pull request #87 from RockyTV/master

Add support for channel keys
1 files changed, 8 insertions(+), 3 deletions(-)

M ChatSharp/IrcClient.Commands.cs
M ChatSharp/IrcClient.Commands.cs => ChatSharp/IrcClient.Commands.cs +8 -3
@@ 74,11 74,16 @@ namespace ChatSharp
        /// <summary>
        /// Joins the specified channel.
        /// </summary>
        public void JoinChannel(string channel)
        public void JoinChannel(string channel, string key = null)
        {
            if (Channels.Contains(channel))
                throw new InvalidOperationException("Client is not already present in channel.");
            SendRawMessage("JOIN {0}", channel);
                throw new InvalidOperationException("Client is already present in channel.");

            string joinCmd = string.Format("JOIN {0}", channel);
            if (!string.IsNullOrEmpty(key))
                joinCmd += string.Format(" {0}", key);

            SendRawMessage(joinCmd, channel);
        }

        /// <summary>