1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

Add federation to ownership change

This commit is contained in:
Chocobozzz 2018-09-04 10:22:10 +02:00
parent 0b74c74abe
commit 5cf84858d4
No known key found for this signature in database
GPG key ID: 583A612D890159BE
13 changed files with 139 additions and 79 deletions

View file

@ -10,13 +10,19 @@ import { getUpdateActivityPubUrl } from '../url'
import { broadcastToFollowers } from './utils'
import { audiencify, getAudience } from '../audience'
import { logger } from '../../../helpers/logger'
import { videoFeedsValidator } from '../../../middlewares/validators'
import { VideoCaptionModel } from '../../../models/video/video-caption'
async function sendUpdateVideo (video: VideoModel, t: Transaction) {
async function sendUpdateVideo (video: VideoModel, t: Transaction, overrodeByActor?: ActorModel) {
logger.info('Creating job to update video %s.', video.url)
const byActor = video.VideoChannel.Account.Actor
const byActor = overrodeByActor ? overrodeByActor : video.VideoChannel.Account.Actor
const url = getUpdateActivityPubUrl(video.url, video.updatedAt.toISOString())
// Needed to build the AP object
if (!video.VideoCaptions) video.VideoCaptions = await video.$get('VideoCaptions') as VideoCaptionModel[]
const videoObject = video.toActivityPubObject()
const audience = getAudience(byActor, video.privacy === VideoPrivacy.PUBLIC)