From 310b5219b38427f0c2c7ba57225afdd8f3064380 Mon Sep 17 00:00:00 2001
From: Chocobozzz <me@florianbigard.com>
Date: Wed, 8 Jul 2020 15:51:46 +0200
Subject: Add new abuses tests

---
 server/lib/emailer.ts                              | 1 +
 server/lib/emails/video-comment-abuse-new/html.pug | 3 ++-
 server/lib/notifier.ts                             | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

(limited to 'server/lib')

diff --git a/server/lib/emailer.ts b/server/lib/emailer.ts
index a5664408d..5a6f37bb9 100644
--- a/server/lib/emailer.ts
+++ b/server/lib/emailer.ts
@@ -325,6 +325,7 @@ class Emailer {
         subject: `New comment abuse report from ${reporter}`,
         locals: {
           commentUrl,
+          videoName: comment.Video.name,
           isLocal: comment.isOwned(),
           commentCreatedAt: new Date(comment.createdAt).toLocaleString(),
           reason: abuse.reason,
diff --git a/server/lib/emails/video-comment-abuse-new/html.pug b/server/lib/emails/video-comment-abuse-new/html.pug
index 170b79576..fc1c3e4e7 100644
--- a/server/lib/emails/video-comment-abuse-new/html.pug
+++ b/server/lib/emails/video-comment-abuse-new/html.pug
@@ -7,7 +7,8 @@ block title
 block content
   p
     | #[a(href=WEBSERVER.URL) #{WEBSERVER.HOST}] received an abuse report for the #{isLocal ? '' : 'remote '}comment "
-    a(href=commentUrl) of #{flaggedAccount}
+    a(href=commentUrl) on video #{videoName}
+    | of #{flaggedAccount}
     | created on #{commentCreatedAt}
 
   p The reporter, #{reporter}, cited the following reason(s):
diff --git a/server/lib/notifier.ts b/server/lib/notifier.ts
index 969e393fa..c567e1c20 100644
--- a/server/lib/notifier.ts
+++ b/server/lib/notifier.ts
@@ -371,7 +371,7 @@ class Notifier {
 
     async function notificationCreator (user: MUserWithNotificationSetting) {
       const notification = await UserNotificationModel.create<UserNotificationModelForApi>({
-        type: UserNotificationType.NEW_VIDEO_ABUSE_FOR_MODERATORS,
+        type: UserNotificationType.NEW_ABUSE_FOR_MODERATORS,
         userId: user.id,
         abuseId: abuse.id
       })
-- 
cgit v1.2.3