feat: send the actual emoji reaction by the like button (close #40)
This commit is contained in:
parent
49c84590c3
commit
622d74b6df
2 changed files with 4 additions and 8 deletions
packages/backend/src/remote/activitypub/renderer
|
@ -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(":")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue