Revert "refactor: 🔥 remove _misskey_reaction and _misskey_votes"
This reverts commit b0be07fb0a
.
This commit is contained in:
parent
2650445576
commit
f06aebca98
@ -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";
|
||||
|
@ -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 {
|
||||
|
@ -18,6 +18,7 @@ export const renderLike = async (noteReaction: NoteReaction, note: Note) => {
|
||||
...(!meta.defaultReaction.includes(reaction)
|
||||
? {
|
||||
content: reaction,
|
||||
_misskey_reaction: reaction,
|
||||
}
|
||||
: {}),
|
||||
} as any;
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user