summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/NoteCreateService.ts
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-03-31 15:02:52 -0400
committerHazelnoot <acomputerdog@gmail.com>2025-03-31 15:02:52 -0400
commite7632c83dc5fde6ac8e7b30ef782947e6717e89a (patch)
treed3d3a7aee7a7aa6ba8a11db82c43de5669674595 /packages/backend/src/core/NoteCreateService.ts
parentcopy sharkey settings into new frontend preferences model (diff)
parentmerge: Prevent streaming API denial-of-service (resolves #1019) (!951) (diff)
downloadsharkey-e7632c83dc5fde6ac8e7b30ef782947e6717e89a.tar.gz
sharkey-e7632c83dc5fde6ac8e7b30ef782947e6717e89a.tar.bz2
sharkey-e7632c83dc5fde6ac8e7b30ef782947e6717e89a.zip
Merge branch 'develop' into merge/2025-03-24
# Conflicts: # packages/backend/src/server/api/StreamingApiServerService.ts # packages/backend/src/server/api/stream/Connection.ts
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 b75b4ecd21..72df948c8b 100644
--- a/packages/backend/src/core/NoteCreateService.ts
+++ b/packages/backend/src/core/NoteCreateService.ts
@@ -839,7 +839,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,