feat: send the actual emoji reaction by the like button (close #40)

This commit is contained in:
naskya 2023-07-20 23:36:31 +00:00
parent 49c84590c3
commit 622d74b6df
Signed by: naskya
GPG key ID: 164DFF24E2D40139
2 changed files with 4 additions and 8 deletions
packages/backend/src/remote/activitypub/renderer

View file

@ -4,23 +4,17 @@ import type { NoteReaction } from "@/models/entities/note-reaction.js";
import type { Note } from "@/models/entities/note.js";
import { Emojis } from "@/models/index.js";
import renderEmoji from "./emoji.js";
import { fetchMeta } from "@/misc/fetch-meta.js";
export const renderLike = async (noteReaction: NoteReaction, note: Note) => {
const reaction = noteReaction.reaction;
const meta = await fetchMeta();
const object = {
type: "Like",
id: `${config.url}/likes/${noteReaction.id}`,
actor: `${config.url}/users/${noteReaction.userId}`,
object: note.uri ? note.uri : `${config.url}/notes/${noteReaction.noteId}`,
...(!meta.defaultReaction.includes(reaction)
? {
content: reaction,
_misskey_reaction: reaction,
}
: {}),
content: reaction,
_misskey_reaction: reaction,
} as any;
if (reaction.startsWith(":")) {