summary refs log tree commit diff
path: root/src/api
diff options
context:
space:
mode:
authorMathMan05 <mathmanrm@gmail.com>2026-02-03 15:33:28 -0600
committerMathMan05 <mathmanrm@gmail.com>2026-02-03 15:33:28 -0600
commiteda0993a9a8737439c48691925ba332b2d4add08 (patch)
tree469a7a91288e6d3ed16b939508501e084ba2d016 /src/api
parentdon't delete a public thread (diff)
downloadserver-ts-eda0993a9a8737439c48691925ba332b2d4add08.tar.xz
correct message sending perms
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/channels/#channel_id/messages/index.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/api/routes/channels/#channel_id/messages/index.ts b/src/api/routes/channels/#channel_id/messages/index.ts

index 110e8901..7f8b4b95 100644 --- a/src/api/routes/channels/#channel_id/messages/index.ts +++ b/src/api/routes/channels/#channel_id/messages/index.ts
@@ -315,7 +315,6 @@ router.post( }, route({ requestBody: "MessageCreateSchema", - permission: "SEND_MESSAGES", right: "SEND_MESSAGES", responses: { 200: { @@ -337,6 +336,11 @@ router.post( where: { id: channel_id }, relations: { recipients: { user: true } }, }); + if (channel.isThread()) { + req.permission!.hasThrow("SEND_MESSAGES_IN_THREADS"); + } else { + req.permission!.hasThrow("SEND_MESSAGES"); + } if (!channel.isWritable()) { throw new HTTPError(`Cannot send messages to channel of type ${channel.type}`, 400); }