Revert "refactor: 🔥 remove _misskey_reaction and _misskey_votes"

This reverts commit b0be07fb0a.
This commit is contained in:
ThatOneCalculator 2023-09-20 22:25:18 -07:00
parent 2650445576
commit f06aebca98
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
4 changed files with 9 additions and 2 deletions

View File

@ -12,7 +12,11 @@ export default async (actor: CacheableRemoteUser, activity: ILike) => {
await extractEmojis(activity.tag || [], actor.host).catch(() => null);
return await create(actor, note, activity.content || activity.name)
return await create(
actor,
note,
activity._misskey_reaction || activity.content || activity.name,
)
.catch((e) => {
if (e.id === "51c42bb4-931a-456b-bff7-e5a8a70dd298") {
return "skip: already reacted";

View File

@ -34,7 +34,7 @@ export async function extractPollFromQuestion(
);
const votes = question[multiple ? "anyOf" : "oneOf"]!.map(
(x, i) => x.replies?.totalItems || 0,
(x, i) => x.replies?.totalItems || x._misskey_votes || 0,
);
return {

View File

@ -18,6 +18,7 @@ export const renderLike = async (noteReaction: NoteReaction, note: Note) => {
...(!meta.defaultReaction.includes(reaction)
? {
content: reaction,
_misskey_reaction: reaction,
}
: {}),
} as any;

View File

@ -158,6 +158,7 @@ export const isQuestion = (object: IObject): object is IQuestion =>
interface IQuestionChoice {
name?: string;
replies?: ICollection;
_misskey_votes?: number;
}
export interface ITombstone extends IObject {
type: "Tombstone";
@ -298,6 +299,7 @@ export interface IRemove extends IActivity {
export interface ILike extends IActivity {
type: "Like" | "EmojiReaction" | "EmojiReact";
_misskey_reaction?: string;
}
export interface IAnnounce extends IActivity {