aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/actor.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-25 11:17:41 +0200
committerChocobozzz <me@florianbigard.com>2018-05-25 11:17:41 +0200
commit16f29007dc6ad9c539195d7a7c1cde45d626ce91 (patch)
tree1f0efc5ebd80f9ad69f69b2998c25f27dbfb844e /server/lib/activitypub/actor.ts
parentad9e39fb815d85e5e718c40540fa75471474fa17 (diff)
downloadPeerTube-16f29007dc6ad9c539195d7a7c1cde45d626ce91.tar.gz
PeerTube-16f29007dc6ad9c539195d7a7c1cde45d626ce91.tar.zst
PeerTube-16f29007dc6ad9c539195d7a7c1cde45d626ce91.zip
Fix cc field in classic audience
Diffstat (limited to 'server/lib/activitypub/actor.ts')
-rw-r--r--server/lib/activitypub/actor.ts20
1 files changed, 19 insertions, 1 deletions
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts
index 4c336f26e..f27733418 100644
--- a/server/lib/activitypub/actor.ts
+++ b/server/lib/activitypub/actor.ts
@@ -19,6 +19,8 @@ import { ActorModel } from '../../models/activitypub/actor'
19import { AvatarModel } from '../../models/avatar/avatar' 19import { AvatarModel } from '../../models/avatar/avatar'
20import { ServerModel } from '../../models/server/server' 20import { ServerModel } from '../../models/server/server'
21import { VideoChannelModel } from '../../models/video/video-channel' 21import { VideoChannelModel } from '../../models/video/video-channel'
22import { JobQueue } from '../job-queue'
23import { getServerActor } from '../../helpers/utils'
22 24
23// Set account keys, this could be long so process after the account creation and do not block the client 25// Set account keys, this could be long so process after the account creation and do not block the client
24function setAsyncActorKeys (actor: ActorModel) { 26function setAsyncActorKeys (actor: ActorModel) {
@@ -169,6 +171,21 @@ async function fetchAvatarIfExists (actorJSON: ActivityPubActor) {
169 return undefined 171 return undefined
170} 172}
171 173
174async function addFetchOutboxJob (actor: ActorModel) {
175 // Don't fetch ourselves
176 const serverActor = await getServerActor()
177 if (serverActor.id === actor.id) {
178 logger.error('Cannot fetch our own outbox!')
179 return undefined
180 }
181
182 const payload = {
183 uris: [ actor.outboxUrl ]
184 }
185
186 return JobQueue.Instance.createJob({ type: 'activitypub-http-fetcher', payload })
187}
188
172export { 189export {
173 getOrCreateActorAndServerAndModel, 190 getOrCreateActorAndServerAndModel,
174 buildActorInstance, 191 buildActorInstance,
@@ -176,7 +193,8 @@ export {
176 fetchActorTotalItems, 193 fetchActorTotalItems,
177 fetchAvatarIfExists, 194 fetchAvatarIfExists,
178 updateActorInstance, 195 updateActorInstance,
179 updateActorAvatarInstance 196 updateActorAvatarInstance,
197 addFetchOutboxJob
180} 198}
181 199
182// --------------------------------------------------------------------------- 200// ---------------------------------------------------------------------------