mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 18:52:41 +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
|
return targetMode != modes.ChannelFounder && targetMode != modes.ChannelAdmin
|
||||||
case modes.Halfop:
|
case modes.Halfop:
|
||||||
// halfops cannot kick other halfops
|
// halfops cannot kick other halfops
|
||||||
return targetMode != modes.ChannelFounder && targetMode != modes.ChannelAdmin && targetMode != modes.Halfop
|
return targetMode == modes.Voice || targetMode == modes.Mode(0)
|
||||||
default:
|
default:
|
||||||
// voice and unprivileged cannot kick anyone
|
// voice and unprivileged cannot kick anyone
|
||||||
return false
|
return false
|
||||||
|
@ -277,6 +277,9 @@ func (channel *Channel) ProcessAccountToUmodeChange(client *Client, change modes
|
|||||||
hasPrivs = true
|
hasPrivs = true
|
||||||
} else if channelUserModeHasPrivsOver(clientMode, targetModeNow) && channelUserModeHasPrivsOver(clientMode, targetModeAfter) {
|
} else if channelUserModeHasPrivsOver(clientMode, targetModeNow) && channelUserModeHasPrivsOver(clientMode, targetModeAfter) {
|
||||||
hasPrivs = true
|
hasPrivs = true
|
||||||
|
} else if change.Op == modes.Remove && account == change.Arg {
|
||||||
|
// you can always de-op yourself
|
||||||
|
hasPrivs = true
|
||||||
}
|
}
|
||||||
if !hasPrivs {
|
if !hasPrivs {
|
||||||
return nil, errInsufficientPrivs
|
return nil, errInsufficientPrivs
|
||||||
|
Loading…
Reference in New Issue
Block a user