- return broadcastToFollowers(data, byActor, toActorsFollowers, t, followersException)
+ return broadcastToFollowers(undoActivity, byActor, actorsInvolvedInVideo, t, followersException)
+}
+
+async function sendUndoCacheFile (byActor: ActorModel, redundancyModel: VideoRedundancyModel, t: Transaction) {
+ logger.info('Creating job to undo cache file %s.', redundancyModel.url)
+
+ const undoUrl = getUndoActivityPubUrl(redundancyModel.url)
+
+ const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(redundancyModel.VideoFile.Video.id)
+ const actorsInvolvedInVideo = await getActorsInvolvedInVideo(video, t)
+
+ const audience = getVideoAudience(video, actorsInvolvedInVideo)
+ const createActivity = buildCreateActivity(redundancyModel.url, byActor, redundancyModel.toActivityPubObject())
+
+ const undoActivity = undoActivityData(undoUrl, byActor, createActivity, audience)
+
+ return unicastTo(undoActivity, byActor, video.VideoChannel.Account.Actor.sharedInboxUrl)