From caf40e40fbd444c050d8d3cc60f4dd2898950900 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Mon, 31 May 2021 13:04:13 +0900 Subject: Supports Array ActivityStreams type (#7536) * Supports Array type * Fix * Fix Service to Note * Update type.ts Co-authored-by: syuilo --- src/remote/activitypub/kernel/update/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/remote/activitypub/kernel/update/index.ts') diff --git a/src/remote/activitypub/kernel/update/index.ts b/src/remote/activitypub/kernel/update/index.ts index ea7e6a063e..6dd3e5f296 100644 --- a/src/remote/activitypub/kernel/update/index.ts +++ b/src/remote/activitypub/kernel/update/index.ts @@ -1,5 +1,5 @@ import { IRemoteUser } from '../../../../models/entities/user'; -import { IUpdate, validActor } from '../../type'; +import { getApType, IUpdate, isActor } from '../../type'; import { apLogger } from '../../logger'; import { updateQuestion } from '../../models/question'; import Resolver from '../../resolver'; @@ -22,13 +22,13 @@ export default async (actor: IRemoteUser, activity: IUpdate): Promise => throw e; }); - if (validActor.includes(object.type)) { + if (isActor(object)) { await updatePerson(actor.uri!, resolver, object); return `ok: Person updated`; - } else if (object.type === 'Question') { + } else if (getApType(object) === 'Question') { await updateQuestion(object).catch(e => console.log(e)); return `ok: Question updated`; } else { - return `skip: Unknown type: ${object.type}`; + return `skip: Unknown type: ${getApType(object)}`; } }; -- cgit v1.2.3-freya