]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/activitypub/process/process-flag.ts
Merge branch 'release/4.0.0' into develop
[github/Chocobozzz/PeerTube.git] / server / lib / activitypub / process / process-flag.ts
index 40d07558c64df23474be869997fab7a10a182c4a..fd3e46e2b4a4333995fa1c2d3092b07f0102fafc 100644 (file)
@@ -49,13 +49,12 @@ async function processCreateAbuse (activity: ActivityCreate | ActivityFlag, byAc
       logger.debug('Reporting remote abuse for object %s.', uri)
 
       await sequelizeTypescript.transaction(async t => {
-
-        const video = await VideoModel.loadByUrlAndPopulateAccount(uri)
+        const video = await VideoModel.loadByUrlAndPopulateAccount(uri, t)
         let videoComment: MCommentOwnerVideo
         let flaggedAccount: MAccountDefault
 
-        if (!video) videoComment = await VideoCommentModel.loadByUrlAndPopulateAccountAndVideo(uri)
-        if (!videoComment) flaggedAccount = await AccountModel.loadByUrl(uri)
+        if (!video) videoComment = await VideoCommentModel.loadByUrlAndPopulateAccountAndVideo(uri, t)
+        if (!videoComment) flaggedAccount = await AccountModel.loadByUrl(uri, t)
 
         if (!video && !videoComment && !flaggedAccount) {
           logger.warn('Cannot flag unknown entity %s.', object)
@@ -76,7 +75,8 @@ async function processCreateAbuse (activity: ActivityCreate | ActivityFlag, byAc
             endAt,
             reporterAccount,
             transaction: t,
-            videoInstance: video
+            videoInstance: video,
+            skipNotification: false
           })
         }
 
@@ -85,7 +85,8 @@ async function processCreateAbuse (activity: ActivityCreate | ActivityFlag, byAc
             baseAbuse,
             reporterAccount,
             transaction: t,
-            commentInstance: videoComment
+            commentInstance: videoComment,
+            skipNotification: false
           })
         }
 
@@ -93,7 +94,8 @@ async function processCreateAbuse (activity: ActivityCreate | ActivityFlag, byAc
           baseAbuse,
           reporterAccount,
           transaction: t,
-          accountInstance: flaggedAccount
+          accountInstance: flaggedAccount,
+          skipNotification: false
         })
       })
     } catch (err) {