Add gitlab ci support
[oweals/peertube.git] / server / controllers / api / videos / abuse.ts
index ca70230a2f475eb05e7a7f40c9821a62fdf15b12..77808466c3cc8128b33423d89af40c77dc3171fe 100644 (file)
@@ -113,16 +113,16 @@ async function reportVideoAbuse (req: express.Request, res: express.Response) {
 
     // We send the video abuse to the origin server
     if (videoInstance.isOwned() === false) {
-      await sendVideoAbuse(reporterAccount.Actor, videoAbuseInstance, videoInstance)
+      await sendVideoAbuse(reporterAccount.Actor, videoAbuseInstance, videoInstance, t)
     }
 
-    Notifier.Instance.notifyOnNewVideoAbuse(videoAbuseInstance)
-
     auditLogger.create(reporterAccount.Actor.getIdentifier(), new VideoAbuseAuditView(videoAbuseInstance.toFormattedJSON()))
 
     return videoAbuseInstance
   })
 
+  Notifier.Instance.notifyOnNewVideoAbuse(videoAbuse)
+
   logger.info('Abuse report for video %s created.', videoInstance.name)
 
   return res.json({ videoAbuse: videoAbuse.toFormattedJSON() }).end()