3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +01:00

server: Check for channel permissions when renaming channels

This commit is contained in:
Daniel Oaks 2017-06-04 20:06:11 -06:00
parent 0f8ab4eaec
commit 4128ff6137

View File

@ -819,6 +819,12 @@ func renameHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
return false
}
//TODO(dan): allow IRCops to do this?
if !channel.ClientIsAtLeast(client, Operator) {
client.Send(nil, server.name, ERR_CHANOPRIVSNEEDED, client.nick, oldName, "Only chanops can rename channels")
return false
}
channel.membersMutex.Lock()
defer channel.membersMutex.Unlock()