1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-06 10:52:31 +01:00

reactions rights enforcement

This commit is contained in:
Erkin Alp Güney 2022-04-17 21:15:58 +03:00
parent 7278c66203
commit f27afe0c56
2 changed files with 3 additions and 2 deletions

View File

@ -4,8 +4,9 @@ import { route } from "@fosscord/api";
const router = Router();
// TODO: check if message exists
// TODO: public read receipts & privacy scoping
// TODO: send read state event to all channel members
// TODO: advance-only notification cursor
export interface MessageAcknowledgeSchema {
manual?: boolean;

View File

@ -101,7 +101,7 @@ router.get("/:emoji", route({ permission: "VIEW_CHANNEL" }), async (req: Request
res.json(users);
});
router.put("/:emoji/:user_id", route({ permission: "READ_MESSAGE_HISTORY" }), async (req: Request, res: Response) => {
router.put("/:emoji/:user_id", route({ permission: "READ_MESSAGE_HISTORY", right: "SELF_ADD_REACTIONS" }), async (req: Request, res: Response) => {
const { message_id, channel_id, user_id } = req.params;
if (user_id !== "@me") throw new HTTPError("Invalid user");
const emoji = getEmoji(req.params.emoji);