- const accountJSON: ActivityPubActor = requestResult.body
- if (isRemoteAccountValid(accountJSON) === false) return undefined
-
- const followersCount = await fetchAccountCount(accountJSON.followers)
- const followingCount = await fetchAccountCount(accountJSON.following)
-
- const account = db.Account.build({
- uuid: accountJSON.uuid,
- name: accountJSON.preferredUsername,
- url: accountJSON.url,
- publicKey: accountJSON.publicKey.publicKeyPem,
- privateKey: null,
- followersCount: followersCount,
- followingCount: followingCount,
- inboxUrl: accountJSON.inbox,
- outboxUrl: accountJSON.outbox,
- sharedInboxUrl: accountJSON.endpoints.sharedInbox,
- followersUrl: accountJSON.followers,
- followingUrl: accountJSON.following
- })
-
- const accountHost = url.parse(account.url).host
- const podOptions = {
- where: {
- host: accountHost
- },
- defaults: {
- host: accountHost
- }
+ return {
+ id: baseUrl + '?page=' + page,
+ type: 'OrderedCollectionPage',
+ prev,
+ next,
+ partOf: baseUrl,
+ orderedItems: result.data,
+ totalItems: result.total