diff options
Diffstat (limited to 'server/lib/notifier.ts')
-rw-r--r-- | server/lib/notifier.ts | 8 |
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' | |||
18 | import { AccountBlocklistModel } from '../models/account/account-blocklist' | 18 | import { AccountBlocklistModel } from '../models/account/account-blocklist' |
19 | import { UserModel } from '../models/account/user' | 19 | import { UserModel } from '../models/account/user' |
20 | import { UserNotificationModel } from '../models/account/user-notification' | 20 | import { UserNotificationModel } from '../models/account/user-notification' |
21 | import { MAbuseFull, MAbuseVideo, MAccountServer, MActorFollowFull } from '../types/models' | 21 | import { MAbuseFull, MAccountServer, MActorFollowFull } from '../types/models' |
22 | import { MCommentOwnerVideo, MVideoAccountLight, MVideoFullLight } from '../types/models/video' | 22 | import { MCommentOwnerVideo, MVideoAccountLight, MVideoFullLight } from '../types/models/video' |
23 | import { isBlockedByServerOrAccount } from './blocklist' | 23 | import { isBlockedByServerOrAccount } from './blocklist' |
24 | import { Emailer } from './emailer' | 24 | import { 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) { |