aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-12-14 09:34:12 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-12-14 09:34:47 +0100
commitf98c39529505cdd409babdb7674dcc779f0ec5af (patch)
tree9deb109d71e1843072975cf0a0ff3effb0462da1
parentb1771455af7ac0e3cfd1018865cc2bb44e048730 (diff)
downloadPeerTube-f98c39529505cdd409babdb7674dcc779f0ec5af.tar.gz
PeerTube-f98c39529505cdd409babdb7674dcc779f0ec5af.tar.zst
PeerTube-f98c39529505cdd409babdb7674dcc779f0ec5af.zip
Keep scope in notifier
-rw-r--r--server/lib/notifier.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/lib/notifier.ts b/server/lib/notifier.ts
index 6af7316f0..740c274d7 100644
--- a/server/lib/notifier.ts
+++ b/server/lib/notifier.ts
@@ -463,11 +463,11 @@ class Notifier {
463 463
464 async function buildReporterOptions () { 464 async function buildReporterOptions () {
465 // Only notify our users 465 // Only notify our users
466 if (abuse.ReporterAccount.isOwned() !== true) return 466 if (abuse.ReporterAccount.isOwned() !== true) return undefined
467 467
468 const reporter = await UserModel.loadByAccountActorId(abuse.ReporterAccount.actorId) 468 const reporter = await UserModel.loadByAccountActorId(abuse.ReporterAccount.actorId)
469 // Don't notify my own message 469 // Don't notify my own message
470 if (reporter.Account.id === message.accountId) return 470 if (reporter.Account.id === message.accountId) return undefined
471 471
472 return { users: [ reporter ], settingGetter, notificationCreator, emailSender: emailSenderReporter } 472 return { users: [ reporter ], settingGetter, notificationCreator, emailSender: emailSenderReporter }
473 } 473 }
@@ -477,7 +477,7 @@ class Notifier {
477 // Don't notify my own message 477 // Don't notify my own message
478 moderators = moderators.filter(m => m.Account.id !== message.accountId) 478 moderators = moderators.filter(m => m.Account.id !== message.accountId)
479 479
480 if (moderators.length === 0) return 480 if (moderators.length === 0) return undefined
481 481
482 return { users: moderators, settingGetter, notificationCreator, emailSender: emailSenderModerators } 482 return { users: moderators, settingGetter, notificationCreator, emailSender: emailSenderModerators }
483 } 483 }
@@ -489,8 +489,8 @@ class Notifier {
489 489
490 return Promise.all( 490 return Promise.all(
491 options 491 options
492 .filter(opt => opt) 492 .filter(opt => !!opt)
493 .map(this.notify) 493 .map(opt => this.notify(opt))
494 ) 494 )
495 } 495 }
496 496