feat: send the actual emoji reaction by the like button

This commit is contained in:
naskya 2024-02-15 23:22:30 +09:00
parent a770ef4314
commit 248cd96a39
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
2 changed files with 6 additions and 8 deletions

View file

@ -1,3 +1,7 @@
# Unreleased
- clicking the "like" button now sends the actual emoji reaction (star, good, heart, etc.) instead of an empty "like"
# v20240215
- separate settings for displaying rounded avatars for cat and non-cat accounts

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(":")) {