1
Fork 0

Enforce clearchat permissions in the server.

It was only being enforced in the client.
This commit is contained in:
Juliusz Chroboczek 2024-05-08 15:38:51 +02:00
parent ebfaeed05f
commit 7a837624e3
1 changed files with 3 additions and 0 deletions

View File

@ -1612,6 +1612,9 @@ func handleClientMessage(c *webClient, m clientMessage) error {
}
switch m.Kind {
case "clearchat":
if !member("op", c.permissions) {
return c.error(group.UserError("not authorised"))
}
g.ClearChatHistory()
m := clientMessage{
Type: "usermessage",