3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-29 23:49:25 +01:00

channel: Fix +m (moderated) and +R (registeredonly) channel modes, add note about opers overriding +m/+R

This commit is contained in:
Daniel Oaks 2017-10-01 15:14:32 +10:00
parent b850a6c1d9
commit e3a0387cf5
2 changed files with 4 additions and 2 deletions

View File

@ -425,6 +425,8 @@ func (channel *Channel) CanSpeak(client *Client) bool {
channel.membersMutex.RLock() channel.membersMutex.RLock()
defer channel.membersMutex.RUnlock() 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] { if client.flags[Operator] {
return true return true
} }

View File

@ -142,8 +142,8 @@ var (
// SupportedChannelModes are the channel modes that we support. // SupportedChannelModes are the channel modes that we support.
SupportedChannelModes = Modes{ SupportedChannelModes = Modes{
BanMask, ExceptMask, InviteMask, InviteOnly, Key, NoOutside, BanMask, ChanRoleplaying, ExceptMask, InviteMask, InviteOnly, Key,
OpOnlyTopic, Secret, UserLimit, ChanRoleplaying, Moderated, NoOutside, OpOnlyTopic, RegisteredOnly, Secret, UserLimit,
} }
// supportedChannelModesString acts as a cache for when we introduce users // supportedChannelModesString acts as a cache for when we introduce users
supportedChannelModesString = SupportedChannelModes.String() supportedChannelModesString = SupportedChannelModes.String()