瀏覽代碼

fix #827

tags/v2.1.0-rc1
Shivaram Lingamneni 4 年之前
父節點
當前提交
04549e7919
共有 1 個檔案被更改,包括 7 行新增0 行删除
  1. 7
    0
      irc/handlers.go

+ 7
- 0
irc/handlers.go 查看文件

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

Loading…
取消
儲存