aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/notifier.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/notifier.ts')
-rw-r--r--server/lib/notifier.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/lib/notifier.ts b/server/lib/notifier.ts
index 40cff66d2..969e393fa 100644
--- a/server/lib/notifier.ts
+++ b/server/lib/notifier.ts
@@ -18,7 +18,7 @@ import { CONFIG } from '../initializers/config'
18import { AccountBlocklistModel } from '../models/account/account-blocklist' 18import { AccountBlocklistModel } from '../models/account/account-blocklist'
19import { UserModel } from '../models/account/user' 19import { UserModel } from '../models/account/user'
20import { UserNotificationModel } from '../models/account/user-notification' 20import { UserNotificationModel } from '../models/account/user-notification'
21import { MAbuseFull, MAbuseVideo, MAccountServer, MActorFollowFull } from '../types/models' 21import { MAbuseFull, MAccountServer, MActorFollowFull } from '../types/models'
22import { MCommentOwnerVideo, MVideoAccountLight, MVideoFullLight } from '../types/models/video' 22import { MCommentOwnerVideo, MVideoAccountLight, MVideoFullLight } from '../types/models/video'
23import { isBlockedByServerOrAccount } from './blocklist' 23import { isBlockedByServerOrAccount } from './blocklist'
24import { Emailer } from './emailer' 24import { Emailer } from './emailer'
@@ -359,12 +359,14 @@ class Notifier {
359 const moderators = await UserModel.listWithRight(UserRight.MANAGE_ABUSES) 359 const moderators = await UserModel.listWithRight(UserRight.MANAGE_ABUSES)
360 if (moderators.length === 0) return 360 if (moderators.length === 0) return
361 361
362 const url = abuseInstance.VideoAbuse?.Video?.url || abuseInstance.VideoCommentAbuse?.VideoComment?.url 362 const url = abuseInstance.VideoAbuse?.Video?.url ||
363 abuseInstance.VideoCommentAbuse?.VideoComment?.url ||
364 abuseInstance.FlaggedAccount.Actor.url
363 365
364 logger.info('Notifying %s user/moderators of new abuse %s.', moderators.length, url) 366 logger.info('Notifying %s user/moderators of new abuse %s.', moderators.length, url)
365 367
366 function settingGetter (user: MUserWithNotificationSetting) { 368 function settingGetter (user: MUserWithNotificationSetting) {
367 return user.NotificationSetting.videoAbuseAsModerator 369 return user.NotificationSetting.abuseAsModerator
368 } 370 }
369 371
370 async function notificationCreator (user: MUserWithNotificationSetting) { 372 async function notificationCreator (user: MUserWithNotificationSetting) {