diff options
Diffstat (limited to 'server/lib/notifier.ts')
-rw-r--r-- | server/lib/notifier.ts | 10 |
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 | ||