From b0be07fb0a223461f4e6ff9857888c26e37d1efd Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Wed, 20 Sep 2023 21:16:03 -0700 Subject: [PATCH] refactor: :fire: remove _misskey_reaction and _misskey_votes BREAKING: breaks poll federation with very old Misskey versions --- packages/backend/src/remote/activitypub/kernel/like.ts | 2 +- packages/backend/src/remote/activitypub/models/question.ts | 2 +- packages/backend/src/remote/activitypub/renderer/like.ts | 1 - packages/backend/src/remote/activitypub/type.ts | 2 -- 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/remote/activitypub/kernel/like.ts b/packages/backend/src/remote/activitypub/kernel/like.ts index 7b30d1cd5..716295518 100644 --- a/packages/backend/src/remote/activitypub/kernel/like.ts +++ b/packages/backend/src/remote/activitypub/kernel/like.ts @@ -15,7 +15,7 @@ export default async (actor: CacheableRemoteUser, activity: ILike) => { return await create( actor, note, - activity._misskey_reaction || activity.content || activity.name, + activity.content || activity.name, ) .catch((e) => { if (e.id === "51c42bb4-931a-456b-bff7-e5a8a70dd298") { diff --git a/packages/backend/src/remote/activitypub/models/question.ts b/packages/backend/src/remote/activitypub/models/question.ts index f5855c3e7..a36b7eff6 100644 --- a/packages/backend/src/remote/activitypub/models/question.ts +++ b/packages/backend/src/remote/activitypub/models/question.ts @@ -34,7 +34,7 @@ export async function extractPollFromQuestion( ); const votes = question[multiple ? "anyOf" : "oneOf"]!.map( - (x, i) => x.replies?.totalItems || x._misskey_votes || 0, + (x, i) => x.replies?.totalItems || 0, ); return { diff --git a/packages/backend/src/remote/activitypub/renderer/like.ts b/packages/backend/src/remote/activitypub/renderer/like.ts index 53c66c5c9..51053c3cc 100644 --- a/packages/backend/src/remote/activitypub/renderer/like.ts +++ b/packages/backend/src/remote/activitypub/renderer/like.ts @@ -18,7 +18,6 @@ export const renderLike = async (noteReaction: NoteReaction, note: Note) => { ...(!meta.defaultReaction.includes(reaction) ? { content: reaction, - _misskey_reaction: reaction, } : {}), } as any; diff --git a/packages/backend/src/remote/activitypub/type.ts b/packages/backend/src/remote/activitypub/type.ts index 2258241b6..17f923ad8 100644 --- a/packages/backend/src/remote/activitypub/type.ts +++ b/packages/backend/src/remote/activitypub/type.ts @@ -158,7 +158,6 @@ export const isQuestion = (object: IObject): object is IQuestion => interface IQuestionChoice { name?: string; replies?: ICollection; - _misskey_votes?: number; } export interface ITombstone extends IObject { type: "Tombstone"; @@ -299,7 +298,6 @@ export interface IRemove extends IActivity { export interface ILike extends IActivity { type: "Like" | "EmojiReaction" | "EmojiReact"; - _misskey_reaction?: string; } export interface IAnnounce extends IActivity {