forked from FoundKeyGang/FoundKey
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
This commit is contained in:
parent
68bc2e314b
commit
b8796cb1fa
4 changed files with 1 additions and 4 deletions
|
@ -23,7 +23,7 @@ export async function extractPollFromQuestion(source: string | IObject, resolver
|
||||||
.map(x => x.name!);
|
.map(x => x.name!);
|
||||||
|
|
||||||
const votes = question[multiple ? 'anyOf' : 'oneOf']!
|
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 {
|
return {
|
||||||
choices,
|
choices,
|
||||||
|
|
|
@ -36,7 +36,6 @@ export const renderActivity = (x: any): IActivity | null => {
|
||||||
// Misskey
|
// Misskey
|
||||||
misskey: 'https://misskey-hub.net/ns#',
|
misskey: 'https://misskey-hub.net/ns#',
|
||||||
'_misskey_quote': 'misskey:_misskey_quote',
|
'_misskey_quote': 'misskey:_misskey_quote',
|
||||||
'_misskey_votes': 'misskey:_misskey_votes',
|
|
||||||
'_misskey_talk': 'misskey:_misskey_talk',
|
'_misskey_talk': 'misskey:_misskey_talk',
|
||||||
'isCat': 'misskey:isCat',
|
'isCat': 'misskey:isCat',
|
||||||
// vcard
|
// vcard
|
||||||
|
|
|
@ -11,7 +11,6 @@ export default async function renderQuestion(user: { id: User['id'] }, note: Not
|
||||||
content: note.text || '',
|
content: note.text || '',
|
||||||
[poll.multiple ? 'anyOf' : 'oneOf']: poll.choices.map((text, i) => ({
|
[poll.multiple ? 'anyOf' : 'oneOf']: poll.choices.map((text, i) => ({
|
||||||
name: text,
|
name: text,
|
||||||
_misskey_votes: poll.votes[i],
|
|
||||||
replies: {
|
replies: {
|
||||||
type: 'Collection',
|
type: 'Collection',
|
||||||
totalItems: poll.votes[i],
|
totalItems: poll.votes[i],
|
||||||
|
|
|
@ -171,7 +171,6 @@ export const isQuestion = (object: IObject): object is IQuestion =>
|
||||||
interface IQuestionChoice {
|
interface IQuestionChoice {
|
||||||
name?: string;
|
name?: string;
|
||||||
replies?: ICollection;
|
replies?: ICollection;
|
||||||
_misskey_votes?: number;
|
|
||||||
}
|
}
|
||||||
export interface ITombstone extends IObject {
|
export interface ITombstone extends IObject {
|
||||||
type: 'Tombstone';
|
type: 'Tombstone';
|
||||||
|
|
Loading…
Reference in a new issue