diff options
| author | MeiMei <30769358+mei23@users.noreply.github.com> | 2019-09-27 04:58:28 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2019-09-27 04:58:28 +0900 |
| commit | e14509574d534a74fcebf9515146b028bbdec153 (patch) | |
| tree | c49aa610bb703ce9b7903059235e69fec3eead11 /src/remote/activitypub/models | |
| parent | Use mk-frac (diff) | |
| download | sharkey-e14509574d534a74fcebf9515146b028bbdec153.tar.gz sharkey-e14509574d534a74fcebf9515146b028bbdec153.tar.bz2 sharkey-e14509574d534a74fcebf9515146b028bbdec153.zip | |
AP featured collectionの修正 / Collection Activityの対応 / typeの修正など (#5460)
* resolver type / fix updateFeatured
* type ApObject
* fix strange type
* AP Activity
* Collection Activityが失敗したらとりあえず無視
Diffstat (limited to 'src/remote/activitypub/models')
| -rw-r--r-- | src/remote/activitypub/models/person.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/remote/activitypub/models/person.ts b/src/remote/activitypub/models/person.ts index 780a05d262..a0b951c5f4 100644 --- a/src/remote/activitypub/models/person.ts +++ b/src/remote/activitypub/models/person.ts @@ -26,6 +26,8 @@ import { UserProfile } from '../../../models/entities/user-profile'; import { validActor } from '../../../remote/activitypub/type'; import { getConnection } from 'typeorm'; import { ensure } from '../../../prelude/ensure'; +import { toArray } from '../../../prelude/array'; + const logger = apLogger; /** @@ -463,8 +465,7 @@ export async function updateFeatured(userId: User['id']) { // Resolve to Object(may be Note) arrays const unresolvedItems = isCollection(collection) ? collection.items : collection.orderedItems; - const items = await resolver.resolve(unresolvedItems); - if (!Array.isArray(items)) throw new Error(`Collection items is not an array`); + const items = await Promise.all(toArray(unresolvedItems).map(x => resolver.resolve(x))); // Resolve and regist Notes const limit = promiseLimit<Note | null>(2); |