feat: send the actual emoji reaction by the like button
This commit is contained in:
parent
a770ef4314
commit
248cd96a39
2 changed files with 6 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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…
Reference in a new issue