From 7bb9cad546a92116567da2bcf40403159c87af29 Mon Sep 17 00:00:00 2001 From: StalkR Date: Thu, 10 Jan 2013 22:22:19 +0100 Subject: [PATCH] state: parse +r/+Z channel modes --- state/channel.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/state/channel.go b/state/channel.go index 2efa424..c87a00c 100644 --- a/state/channel.go +++ b/state/channel.go @@ -18,6 +18,7 @@ type Channel struct { // A struct representing the modes of an IRC Channel // (the ones we care about, at least). +// http://www.unrealircd.com/files/docs/unreal32docs.html#userchannelmodes type ChanMode struct { // MODE +p, +s, +t, +n, +m Private, Secret, ProtectedTopic, NoExternalMsg, Moderated bool @@ -25,6 +26,9 @@ type ChanMode struct { // MODE +i, +O, +z InviteOnly, OperOnly, SSLOnly bool + // MODE +r, +Z + Registered, AllSSL bool + // MODE +k Key string @@ -49,6 +53,8 @@ var ChanModeToString = map[string]string{ "InviteOnly": "i", "OperOnly": "O", "SSLOnly": "z", + "Registered": "r", + "AllSSL": "Z", "Key": "k", "Limit": "l", } @@ -152,12 +158,16 @@ func (ch *Channel) ParseModes(modes string, modeargs ...string) { ch.Modes.NoExternalMsg = modeop case 'p': ch.Modes.Private = modeop + case 'r': + ch.Modes.Registered = modeop case 's': ch.Modes.Secret = modeop case 't': ch.Modes.ProtectedTopic = modeop case 'z': ch.Modes.SSLOnly = modeop + case 'Z': + ch.Modes.AllSSL = modeop case 'O': ch.Modes.OperOnly = modeop case 'k':