logger.info('Creating job to send an unfollow request to %s.', following.url)
- const followUrl = getActorFollowActivityPubUrl(actorFollow)
+ const followUrl = getActorFollowActivityPubUrl(me, following)
const undoUrl = getUndoActivityPubUrl(followUrl)
const followActivity = buildFollowActivity(followUrl, me, following)
const undoActivity = undoActivityData(undoUrl, me, followActivity)
- return unicastTo(undoActivity, me, following.inboxUrl)
+ t.afterCommit(() => unicastTo(undoActivity, me, following.inboxUrl))
}
async function sendUndoAnnounce (byActor: ActorModel, videoShare: VideoShareModel, video: VideoModel, t: Transaction) {
async function sendUndoCacheFile (byActor: ActorModel, redundancyModel: VideoRedundancyModel, t: Transaction) {
logger.info('Creating job to undo cache file %s.', redundancyModel.url)
- const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(redundancyModel.VideoFile.Video.id)
+ const videoId = redundancyModel.getVideo().id
+ const video = await VideoModel.loadAndPopulateAccountAndServerAndTags(videoId)
const createActivity = buildCreateActivity(redundancyModel.url, byActor, redundancyModel.toActivityPubObject())
return sendUndoVideoRelatedActivity({ byActor, video, url: redundancyModel.url, activity: createActivity, transaction: t })