Also ensure that people can remove their own persistent modes via CS AMODE
This commit is contained in:
Shivaram Lingamneni 2019-05-23 18:33:41 -04:00
parent 678c8606b6
commit 0835ad6af5
2 changed files with 4 additions and 1 deletions

View file

@ -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