mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
fix #514
Also ensure that people can remove their own persistent modes via CS AMODE
This commit is contained in:
parent
678c8606b6
commit
0835ad6af5
@ -395,7 +395,7 @@ func channelUserModeHasPrivsOver(clientMode modes.Mode, targetMode modes.Mode) b
|
||||
return targetMode != modes.ChannelFounder && targetMode != modes.ChannelAdmin
|
||||
case modes.Halfop:
|
||||
// halfops cannot kick other halfops
|
||||
return targetMode != modes.ChannelFounder && targetMode != modes.ChannelAdmin && targetMode != modes.Halfop
|
||||
return targetMode == modes.Voice || targetMode == modes.Mode(0)
|
||||
default:
|
||||
// voice and unprivileged cannot kick anyone
|
||||
return false
|
||||
|
@ -277,6 +277,9 @@ func (channel *Channel) ProcessAccountToUmodeChange(client *Client, change modes
|
||||
hasPrivs = true
|
||||
} else if channelUserModeHasPrivsOver(clientMode, targetModeNow) && channelUserModeHasPrivsOver(clientMode, targetModeAfter) {
|
||||
hasPrivs = true
|
||||
} else if change.Op == modes.Remove && account == change.Arg {
|
||||
// you can always de-op yourself
|
||||
hasPrivs = true
|
||||
}
|
||||
if !hasPrivs {
|
||||
return nil, errInsufficientPrivs
|
||||
|
Loading…
Reference in New Issue
Block a user