summaryrefslogtreecommitdiff
path: root/src/remote/activitypub/kernel/update/index.ts
diff options
context:
space:
mode:
authorMeiMei <30769358+mei23@users.noreply.github.com>2021-05-31 13:04:13 +0900
committerGitHub <noreply@github.com>2021-05-31 13:04:13 +0900
commitcaf40e40fbd444c050d8d3cc60f4dd2898950900 (patch)
tree480f907740d8c9e86d9dea7bd8d9845f3e31b68e /src/remote/activitypub/kernel/update/index.ts
parentNew Crowdin updates (#7527) (diff)
downloadsharkey-caf40e40fbd444c050d8d3cc60f4dd2898950900.tar.gz
sharkey-caf40e40fbd444c050d8d3cc60f4dd2898950900.tar.bz2
sharkey-caf40e40fbd444c050d8d3cc60f4dd2898950900.zip
Supports Array ActivityStreams type (#7536)
* Supports Array type * Fix * Fix Service to Note * Update type.ts Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'src/remote/activitypub/kernel/update/index.ts')
-rw-r--r--src/remote/activitypub/kernel/update/index.ts8
1 files changed, 4 insertions, 4 deletions
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<string> =>
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)}`;
}
};