diff options
author | Chocobozzz <me@florianbigard.com> | 2020-07-07 14:34:16 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-07-10 14:02:41 +0200 |
commit | 4f32032fed8587ea97d45e235b167e8958efd81f (patch) | |
tree | 6ec4ce2d5d05a275fb7eeaf3aee33c2b69ebc043 /server/lib/notifier.ts | |
parent | 57f6896f67cfc570cf3605dd94b0778101b2d9b9 (diff) | |
download | PeerTube-4f32032fed8587ea97d45e235b167e8958efd81f.tar.gz PeerTube-4f32032fed8587ea97d45e235b167e8958efd81f.tar.zst PeerTube-4f32032fed8587ea97d45e235b167e8958efd81f.zip |
Add migrations
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) { |