Fix: AP object / actor type (#5086)

* attributedToがArrayの場合などに対応

* attachment以外で来るDocument系のObjectに対応

* Renote, Reply 対応

* 表示をいい感じに

* fix type

* revert as const

* Fix Note / Question type

* attributedToのtypeで複合配列を想定する
This commit is contained in:
MeiMei
2019-06-28 18:54:10 +09:00
committed by syuilo
parent a8379e3bc9
commit 0141affe05
10 changed files with 86 additions and 87 deletions

View File

@ -10,7 +10,7 @@ import { Users, Notes } from '../../../../models';
import { Note } from '../../../../models/entities/note';
import { User } from '../../../../models/entities/user';
import { fetchMeta } from '../../../../misc/fetch-meta';
import { validActor } from '../../../../remote/activitypub/type';
import { validActor, validPost } from '../../../../remote/activitypub/type';
export const meta = {
tags: ['federation'],
@ -145,7 +145,7 @@ async function fetchAny(uri: string) {
};
}
if (['Note', 'Question', 'Article'].includes(object.type)) {
if (validPost.includes(object.type)) {
const note = await createNote(object.id, undefined, true);
return {
type: 'Note',