3
0
mirror of https://github.com/ergochat/ergo.git synced 2025-01-03 08:32:43 +01:00

Merge pull request #1262 from slingamn/founderkick

make channel founder unkickable
This commit is contained in:
Shivaram Lingamneni 2020-09-10 02:41:05 -07:00 committed by GitHub
commit f03602905b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -553,9 +553,12 @@ func (channel *Channel) ClientHasPrivsOver(client *Client, target *Client) bool
targetModes := channel.members[target]
channel.stateMutex.RUnlock()
if founder != "" && founder == client.Account() {
// #950: founder can kick or whatever without actually having the +q mode
return true
if founder != "" {
if founder == client.Account() {
return true // #950: founder can take any privileged action without actually having +q
} else if founder == target.Account() {
return false // conversely, only the founder can kick the founder
}
}
return channelUserModeHasPrivsOver(clientModes.HighestChannelUserMode(), targetModes.HighestChannelUserMode())