3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-23 11:12:44 +01:00
Having the 'samode' capability made all KICK commands privileged. This appears
to have been introduced unintentionally by 42316bc04f and I can't find
any discussion of a rationale. Since this goes against our policy that all
ircop (as opposed to channel founder) privileges must be invoked explicitly
(e.g. SAJOIN, SAMODE), remove this.
This commit is contained in:
Shivaram Lingamneni 2022-02-07 19:06:31 -05:00
parent 6c0e9619cb
commit fcb86c54f7

View File

@ -1340,7 +1340,6 @@ func sajoinHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respo
// the number of users.
// Addditionally, we support multiple channels and a single user.
func kickHandler(server *Server, client *Client, msg ircmsg.Message, rb *ResponseBuffer) bool {
hasPrivs := client.HasRoleCapabs("samode")
channels := strings.Split(msg.Params[0], ",")
users := strings.Split(msg.Params[1], ",")
if (len(channels) != len(users)) && (len(users) != 1) && (len(channels) != 1) {
@ -1398,7 +1397,7 @@ func kickHandler(server *Server, client *Client, msg ircmsg.Message, rb *Respons
rb.Add(nil, server.name, ERR_NOSUCHNICK, client.nick, utils.SafeErrorParam(kick.nick), client.t("No such nick"))
continue
}
channel.Kick(client, target, comment, rb, hasPrivs)
channel.Kick(client, target, comment, rb, false)
}
return false
}