diff options
| author | Lilly Schramm <privat@eps-dev.de> | 2025-06-18 20:08:06 +0200 |
|---|---|---|
| committer | Lilly Schramm <privat@eps-dev.de> | 2025-06-18 20:08:06 +0200 |
| commit | 789deeabac4b7c3119904a006caa59a35c0c0df6 (patch) | |
| tree | c6e1f7409b0369c244a04572fb6e32c4d33e4cff /packages/backend/src/core | |
| parent | merge: Check privacy settings in charts/user/following (resolves #1107) (!1124) (diff) | |
| download | sharkey-789deeabac4b7c3119904a006caa59a35c0c0df6.tar.gz sharkey-789deeabac4b7c3119904a006caa59a35c0c0df6.tar.bz2 sharkey-789deeabac4b7c3119904a006caa59a35c0c0df6.zip | |
fix(backend): Send Abuse Reports To Set Maintainer E-Mail
Diffstat (limited to 'packages/backend/src/core')
| -rw-r--r-- | packages/backend/src/core/AbuseReportNotificationService.ts | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/packages/backend/src/core/AbuseReportNotificationService.ts b/packages/backend/src/core/AbuseReportNotificationService.ts index 9bca795479..a67e5e19a7 100644 --- a/packages/backend/src/core/AbuseReportNotificationService.ts +++ b/packages/backend/src/core/AbuseReportNotificationService.ts @@ -83,6 +83,25 @@ export class AbuseReportNotificationService implements OnApplicationShutdown { } /** + * Collects all email addresses that a abuse report should be sent to. + */ + @bindThis + public async getRecipientEMailAddresses(): Promise<string[]> { + const recipientEMailAddresses = await this.fetchEMailRecipients().then(it => it + .filter(it => it.isActive && it.userProfile?.emailVerified) + .map(it => it.userProfile?.email) + .filter(x => x != null), + ); + + recipientEMailAddresses.push( + ...(this.meta.email ? [this.meta.email] : []), + ...(this.meta.maintainerEmail ? [this.meta.maintainerEmail] : []), + ); + + return recipientEMailAddresses; + } + + /** * Mailを用いて{@link abuseReports}の内容を管理者各位に通知する. * メールアドレスの送信先は以下の通り. * - モデレータ権限所有者ユーザ(設定画面からメールアドレスの設定を行っているユーザに限る) @@ -96,15 +115,7 @@ export class AbuseReportNotificationService implements OnApplicationShutdown { return; } - const recipientEMailAddresses = await this.fetchEMailRecipients().then(it => it - .filter(it => it.isActive && it.userProfile?.emailVerified) - .map(it => it.userProfile?.email) - .filter(x => x != null), - ); - - recipientEMailAddresses.push( - ...(this.meta.email ? [this.meta.email] : []), - ); + const recipientEMailAddresses = await this.getRecipientEMailAddresses(); if (recipientEMailAddresses.length <= 0) { return; |