aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/notifier.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-07-07 14:34:16 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-07-10 14:02:41 +0200
commit4f32032fed8587ea97d45e235b167e8958efd81f (patch)
tree6ec4ce2d5d05a275fb7eeaf3aee33c2b69ebc043 /server/lib/notifier.ts
parent57f6896f67cfc570cf3605dd94b0778101b2d9b9 (diff)
downloadPeerTube-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.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) {