Only offer reply and reactions on bot messages

The user's own messages no longer get the reply and react row. A bot's
reaction to one still shows, read-only, and react-message refuses a
reaction on the user's own message.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-19 22:04:29 +01:00
co-authored by Claude Opus 5.5
parent d1b5b6d68a
commit 100ef0eb89
5 changed files with 40 additions and 17 deletions
+7 -2
View File
@@ -10,8 +10,8 @@ import isReadOnlyUser from "@/src/utils/rbac/is-read-only-user";
import safeErrorMessage from "@/src/utils/safe-error-message";
/**
* Adds or takes back one of the fixed emoji reactions on a message in the
* session user's own conversation, and pushes the message's fresh
* Adds or takes back one of the fixed emoji reactions on a bot message in
* the session user's own conversation, and pushes the message's fresh
* reactions to their other open tabs.
*/
export const handler: BunextAPIRouteHandler<APIResponseObject> = async ({ req, body }) => {
@@ -36,6 +36,11 @@ export const handler: BunextAPIRouteHandler<APIResponseObject> = async ({ req, b
});
const message = await grabUserBotMessage({ user_id: user.id, message_id });
if (message.author == "user") {
throw new AppError(`You can only react to the bot's messages.`);
}
const reactions = await toggleMessageReaction({
message_id: Number(message.id),
user_id: user.id,