summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/NoteCreateService.ts
diff options
context:
space:
mode:
authorJacob Hall <email@jacobhall.net>2025-02-20 15:09:48 -0500
committerJacob Hall <email@jacobhall.net>2025-02-20 15:09:48 -0500
commit187c98e5acb4e20df263a914ae64c72a6414da60 (patch)
tree0ae83e6c1b4c374233b0073a6e49564970962496 /packages/backend/src/core/NoteCreateService.ts
parentmerge: Add separate redis for rate limit (!908) (diff)
downloadsharkey-187c98e5acb4e20df263a914ae64c72a6414da60.tar.gz
sharkey-187c98e5acb4e20df263a914ae64c72a6414da60.tar.bz2
sharkey-187c98e5acb4e20df263a914ae64c72a6414da60.zip
do not notify mentioned users if a DM is not visible to them
Diffstat (limited to 'packages/backend/src/core/NoteCreateService.ts')
-rw-r--r--packages/backend/src/core/NoteCreateService.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts
index 3bfced1d80..a907b4a42f 100644
--- a/packages/backend/src/core/NoteCreateService.ts
+++ b/packages/backend/src/core/NoteCreateService.ts
@@ -861,7 +861,8 @@ export class NoteCreateService implements OnApplicationShutdown {
@bindThis
private async createMentionedEvents(mentionedUsers: MinimumUser[], note: MiNote, nm: NotificationManager) {
- for (const u of mentionedUsers.filter(u => this.userEntityService.isLocalUser(u))) {
+ // Only create mention events for local users, and users for whom the note is visible
+ for (const u of mentionedUsers.filter(u => (note.visibility !== 'specified' || note.visibleUserIds.some(x => x === u.id)) && this.userEntityService.isLocalUser(u))) {
const isThreadMuted = await this.noteThreadMutingsRepository.exists({
where: {
userId: u.id,