From 4f32032fed8587ea97d45e235b167e8958efd81f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 7 Jul 2020 14:34:16 +0200 Subject: Add migrations --- server/lib/notifier.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'server/lib/notifier.ts') 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' import { AccountBlocklistModel } from '../models/account/account-blocklist' import { UserModel } from '../models/account/user' import { UserNotificationModel } from '../models/account/user-notification' -import { MAbuseFull, MAbuseVideo, MAccountServer, MActorFollowFull } from '../types/models' +import { MAbuseFull, MAccountServer, MActorFollowFull } from '../types/models' import { MCommentOwnerVideo, MVideoAccountLight, MVideoFullLight } from '../types/models/video' import { isBlockedByServerOrAccount } from './blocklist' import { Emailer } from './emailer' @@ -359,12 +359,14 @@ class Notifier { const moderators = await UserModel.listWithRight(UserRight.MANAGE_ABUSES) if (moderators.length === 0) return - const url = abuseInstance.VideoAbuse?.Video?.url || abuseInstance.VideoCommentAbuse?.VideoComment?.url + const url = abuseInstance.VideoAbuse?.Video?.url || + abuseInstance.VideoCommentAbuse?.VideoComment?.url || + abuseInstance.FlaggedAccount.Actor.url logger.info('Notifying %s user/moderators of new abuse %s.', moderators.length, url) function settingGetter (user: MUserWithNotificationSetting) { - return user.NotificationSetting.videoAbuseAsModerator + return user.NotificationSetting.abuseAsModerator } async function notificationCreator (user: MUserWithNotificationSetting) { -- cgit v1.2.3