3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-26 13:59:44 +01:00

Merge pull request #944 from slingamn/issue827_rename

fix #827
This commit is contained in:
Shivaram Lingamneni 2020-04-13 10:13:47 -07:00 committed by GitHub
commit f07a456688
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2229,6 +2229,13 @@ func renameHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Re
return false return false
} }
config := server.Config()
status, _ := channel.historyStatus(config)
if status == HistoryPersistent {
rb.Add(nil, server.name, ERR_CANNOTRENAME, client.Nick(), oldName, newName, client.t("Channels with persistent history cannot be renamed"))
return false
}
// perform the channel rename // perform the channel rename
err := server.channels.Rename(oldName, newName) err := server.channels.Rename(oldName, newName)
if err == errInvalidChannelName { if err == errInvalidChannelName {