diff options
Diffstat (limited to 'server/lib/activitypub/process/process-delete.ts')
-rw-r--r-- | server/lib/activitypub/process/process-delete.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/activitypub/process/process-delete.ts b/server/lib/activitypub/process/process-delete.ts index 845a7b249..9fcfd9e3a 100644 --- a/server/lib/activitypub/process/process-delete.ts +++ b/server/lib/activitypub/process/process-delete.ts | |||
@@ -34,7 +34,7 @@ async function processDeleteActivity (options: APProcessorOptions<ActivityDelete | |||
34 | } | 34 | } |
35 | 35 | ||
36 | { | 36 | { |
37 | const videoCommentInstance = await VideoCommentModel.loadByUrlAndPopulateAccount(objectUrl) | 37 | const videoCommentInstance = await VideoCommentModel.loadByUrlAndPopulateAccountAndVideo(objectUrl) |
38 | if (videoCommentInstance) { | 38 | if (videoCommentInstance) { |
39 | return retryTransactionWrapper(processDeleteVideoComment, byActor, videoCommentInstance, activity) | 39 | return retryTransactionWrapper(processDeleteVideoComment, byActor, videoCommentInstance, activity) |
40 | } | 40 | } |
@@ -121,8 +121,8 @@ function processDeleteVideoComment (byActor: ActorModel, videoComment: VideoComm | |||
121 | logger.debug('Removing remote video comment "%s".', videoComment.url) | 121 | logger.debug('Removing remote video comment "%s".', videoComment.url) |
122 | 122 | ||
123 | return sequelizeTypescript.transaction(async t => { | 123 | return sequelizeTypescript.transaction(async t => { |
124 | if (videoComment.Account.id !== byActor.Account.id) { | 124 | if (byActor.Account.id !== videoComment.Account.id && byActor.Account.id !== videoComment.Video.VideoChannel.accountId) { |
125 | throw new Error('Account ' + byActor.url + ' does not own video comment ' + videoComment.url) | 125 | throw new Error(`Account ${byActor.url} does not own video comment ${videoComment.url} or video ${videoComment.Video.url}`) |
126 | } | 126 | } |
127 | 127 | ||
128 | await videoComment.destroy({ transaction: t }) | 128 | await videoComment.destroy({ transaction: t }) |