From e3a0387cf5213394af5918f2ecb5842b6ba74387 Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Sun, 1 Oct 2017 15:14:32 +1000 Subject: [PATCH] channel: Fix +m (moderated) and +R (registeredonly) channel modes, add note about opers overriding +m/+R --- irc/channel.go | 2 ++ irc/modes.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/irc/channel.go b/irc/channel.go index 94f6c280..a82c1f08 100644 --- a/irc/channel.go +++ b/irc/channel.go @@ -425,6 +425,8 @@ func (channel *Channel) CanSpeak(client *Client) bool { channel.membersMutex.RLock() defer channel.membersMutex.RUnlock() + // server operators override nooutside, reggedonly, moderated etc. + // TODO(dan): there should probably instead be a SAPRIVMSG instead that forces this instead of doing it this way... if client.flags[Operator] { return true } diff --git a/irc/modes.go b/irc/modes.go index 4f417a66..c910c53d 100644 --- a/irc/modes.go +++ b/irc/modes.go @@ -142,8 +142,8 @@ var ( // SupportedChannelModes are the channel modes that we support. SupportedChannelModes = Modes{ - BanMask, ExceptMask, InviteMask, InviteOnly, Key, NoOutside, - OpOnlyTopic, Secret, UserLimit, ChanRoleplaying, + BanMask, ChanRoleplaying, ExceptMask, InviteMask, InviteOnly, Key, + Moderated, NoOutside, OpOnlyTopic, RegisteredOnly, Secret, UserLimit, } // supportedChannelModesString acts as a cache for when we introduce users supportedChannelModesString = SupportedChannelModes.String()