- const followersException = [ byActor ]
- return broadcastToFollowers(undoActivity, byActor, actorsInvolvedInVideo, t, followersException)
+async function sendUndoCacheFile (byActor: MActor, redundancyModel: MVideoRedundancyVideo, transaction: Transaction) {
+ logger.info('Creating job to undo cache file %s.', redundancyModel.url)
+
+ const associatedVideo = redundancyModel.getVideo()
+ if (!associatedVideo) {
+ logger.warn('Cannot send undo activity for redundancy %s: no video files associated.', redundancyModel.url)
+ return
+ }
+
+ const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(associatedVideo.id)
+ const createActivity = buildCreateActivity(redundancyModel.url, byActor, redundancyModel.toActivityPubObject())
+
+ return sendUndoVideoRelatedActivity({
+ byActor,
+ video,
+ url: redundancyModel.url,
+ activity: createActivity,
+ contextType: 'CacheFile',
+ transaction
+ })