-async function sendDeleteAccount (account: AccountInstance, t: Transaction) {
- const data = deleteActivityData(account.url, account)
+async function sendDeleteVideoComment (videoComment: VideoCommentModel, t: Transaction) {
+ logger.info('Creating job to send delete of comment %s.', videoComment.url)
+
+ const isVideoOrigin = videoComment.Video.isOwned()
+
+ const url = getDeleteActivityPubUrl(videoComment.url)
+ const byActor = videoComment.Account.Actor
+ const threadParentComments = await VideoCommentModel.listThreadParentComments(videoComment, t)
+
+ const actorsInvolvedInComment = await getActorsInvolvedInVideo(videoComment.Video, t)
+ actorsInvolvedInComment.push(byActor)
+
+ const audience = getVideoCommentAudience(videoComment, threadParentComments, actorsInvolvedInComment, isVideoOrigin)
+ const data = deleteActivityData(url, videoComment.url, byActor, audience)