From b8796cb1faeca3f547759ba4709ce525ce23af1f Mon Sep 17 00:00:00 2001 From: Johann150 Date: Sat, 11 Feb 2023 17:49:12 +0100 Subject: [PATCH] activitypub: remove _misskey_votes property This is a duplication of `replies.totalItems` and seems unnecessary, it is even only parsed by Misskey if the afforementioned property is not available. Changelog: Removed --- packages/backend/src/remote/activitypub/models/question.ts | 2 +- packages/backend/src/remote/activitypub/renderer/index.ts | 1 - packages/backend/src/remote/activitypub/renderer/question.ts | 1 - packages/backend/src/remote/activitypub/type.ts | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/backend/src/remote/activitypub/models/question.ts b/packages/backend/src/remote/activitypub/models/question.ts index 5d88e1d44..803acee66 100644 --- a/packages/backend/src/remote/activitypub/models/question.ts +++ b/packages/backend/src/remote/activitypub/models/question.ts @@ -23,7 +23,7 @@ export async function extractPollFromQuestion(source: string | IObject, resolver .map(x => x.name!); const votes = question[multiple ? 'anyOf' : 'oneOf']! - .map(x => x.replies && x.replies.totalItems || x._misskey_votes || 0); + .map(x => x.replies && x.replies.totalItems || 0); return { choices, diff --git a/packages/backend/src/remote/activitypub/renderer/index.ts b/packages/backend/src/remote/activitypub/renderer/index.ts index 0ea143cda..b66f766a2 100644 --- a/packages/backend/src/remote/activitypub/renderer/index.ts +++ b/packages/backend/src/remote/activitypub/renderer/index.ts @@ -36,7 +36,6 @@ export const renderActivity = (x: any): IActivity | null => { // Misskey misskey: 'https://misskey-hub.net/ns#', '_misskey_quote': 'misskey:_misskey_quote', - '_misskey_votes': 'misskey:_misskey_votes', '_misskey_talk': 'misskey:_misskey_talk', 'isCat': 'misskey:isCat', // vcard diff --git a/packages/backend/src/remote/activitypub/renderer/question.ts b/packages/backend/src/remote/activitypub/renderer/question.ts index d4d1b590a..a6116888a 100644 --- a/packages/backend/src/remote/activitypub/renderer/question.ts +++ b/packages/backend/src/remote/activitypub/renderer/question.ts @@ -11,7 +11,6 @@ export default async function renderQuestion(user: { id: User['id'] }, note: Not content: note.text || '', [poll.multiple ? 'anyOf' : 'oneOf']: poll.choices.map((text, i) => ({ name: text, - _misskey_votes: poll.votes[i], replies: { type: 'Collection', totalItems: poll.votes[i], diff --git a/packages/backend/src/remote/activitypub/type.ts b/packages/backend/src/remote/activitypub/type.ts index a14133ddc..b4d0499c5 100644 --- a/packages/backend/src/remote/activitypub/type.ts +++ b/packages/backend/src/remote/activitypub/type.ts @@ -171,7 +171,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';