aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub/send/send-update.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-09-04 10:22:10 +0200
committerChocobozzz <me@florianbigard.com>2018-09-04 10:49:53 +0200
commit5cf84858d49f4231cc4efec5e3132f17f65f6cf6 (patch)
treef1ff23476ff54c32c3fa34db79c11f242855d3b4 /server/lib/activitypub/send/send-update.ts
parent0b74c74abe5a44e9f564ab6adb5177ab17d28e91 (diff)
downloadPeerTube-5cf84858d49f4231cc4efec5e3132f17f65f6cf6.tar.gz
PeerTube-5cf84858d49f4231cc4efec5e3132f17f65f6cf6.tar.zst
PeerTube-5cf84858d49f4231cc4efec5e3132f17f65f6cf6.zip
Add federation to ownership change
Diffstat (limited to 'server/lib/activitypub/send/send-update.ts')
-rw-r--r--server/lib/activitypub/send/send-update.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/server/lib/activitypub/send/send-update.ts b/server/lib/activitypub/send/send-update.ts
index 17d4f185c..6f1d80898 100644
--- a/server/lib/activitypub/send/send-update.ts
+++ b/server/lib/activitypub/send/send-update.ts
@@ -10,13 +10,19 @@ import { getUpdateActivityPubUrl } from '../url'
10import { broadcastToFollowers } from './utils' 10import { broadcastToFollowers } from './utils'
11import { audiencify, getAudience } from '../audience' 11import { audiencify, getAudience } from '../audience'
12import { logger } from '../../../helpers/logger' 12import { logger } from '../../../helpers/logger'
13import { videoFeedsValidator } from '../../../middlewares/validators'
14import { VideoCaptionModel } from '../../../models/video/video-caption'
13 15
14async function sendUpdateVideo (video: VideoModel, t: Transaction) { 16async function sendUpdateVideo (video: VideoModel, t: Transaction, overrodeByActor?: ActorModel) {
15 logger.info('Creating job to update video %s.', video.url) 17 logger.info('Creating job to update video %s.', video.url)
16 18
17 const byActor = video.VideoChannel.Account.Actor 19 const byActor = overrodeByActor ? overrodeByActor : video.VideoChannel.Account.Actor
18 20
19 const url = getUpdateActivityPubUrl(video.url, video.updatedAt.toISOString()) 21 const url = getUpdateActivityPubUrl(video.url, video.updatedAt.toISOString())
22
23 // Needed to build the AP object
24 if (!video.VideoCaptions) video.VideoCaptions = await video.$get('VideoCaptions') as VideoCaptionModel[]
25
20 const videoObject = video.toActivityPubObject() 26 const videoObject = video.toActivityPubObject()
21 const audience = getAudience(byActor, video.privacy === VideoPrivacy.PUBLIC) 27 const audience = getAudience(byActor, video.privacy === VideoPrivacy.PUBLIC)
22 28