import { AvatarModel } from '../../models/avatar/avatar'
import { ServerModel } from '../../models/server/server'
import { VideoChannelModel } from '../../models/video/video-channel'
+import { JobQueue } from '../job-queue'
+import { getServerActor } from '../../helpers/utils'
// Set account keys, this could be long so process after the account creation and do not block the client
function setAsyncActorKeys (actor: ActorModel) {
return undefined
}
+async function addFetchOutboxJob (actor: ActorModel) {
+ // Don't fetch ourselves
+ const serverActor = await getServerActor()
+ if (serverActor.id === actor.id) {
+ logger.error('Cannot fetch our own outbox!')
+ return undefined
+ }
+
+ const payload = {
+ uris: [ actor.outboxUrl ]
+ }
+
+ return JobQueue.Instance.createJob({ type: 'activitypub-http-fetcher', payload })
+}
+
export {
getOrCreateActorAndServerAndModel,
buildActorInstance,
fetchActorTotalItems,
fetchAvatarIfExists,
updateActorInstance,
- updateActorAvatarInstance
+ updateActorAvatarInstance,
+ addFetchOutboxJob
}
// ---------------------------------------------------------------------------
+++ /dev/null
-import { logger } from '../../helpers/logger'
-import { getServerActor } from '../../helpers/utils'
-import { ActorModel } from '../../models/activitypub/actor'
-import { JobQueue } from '../job-queue'
-
-async function addFetchOutboxJob (actor: ActorModel) {
- // Don't fetch ourselves
- const serverActor = await getServerActor()
- if (serverActor.id === actor.id) {
- logger.error('Cannot fetch our own outbox!')
- return undefined
- }
-
- const payload = {
- uris: [ actor.outboxUrl ]
- }
-
- return JobQueue.Instance.createJob({ type: 'activitypub-http-fetcher', payload })
-}
-
-export {
- addFetchOutboxJob
-}
import { getActorUrl } from '../../../helpers/activitypub'
import { ActorModel } from '../../../models/activitypub/actor'
import { ActorFollowModel } from '../../../models/activitypub/actor-follow'
-import { addFetchOutboxJob } from '../fetch'
+import { addFetchOutboxJob } from '../actor'
async function processAcceptActivity (activity: ActivityAccept, inboxActor?: ActorModel) {
if (inboxActor === undefined) throw new Error('Need to accept on explicit inbox.')
}
async function getAudience (actorSender: ActorModel, t: Transaction, isPublic = true) {
- const followerInboxUrls = await actorSender.getFollowerSharedInboxUrls(t)
-
- return buildAudience(followerInboxUrls, isPublic)
+ return buildAudience([ actorSender.followersUrl ], isPublic)
}
function buildAudience (followerInboxUrls: string[], isPublic = true) {