From e93e73673ab7cc3f761eeef651295efaac3708a5 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 26 Jan 2024 18:09:25 +0000 Subject: [PATCH] probably more correct muting logic we want to notify if neither the thread nor the user are muted; otherwise, for example, notes in a muted thread from a non-muted user would get notified --- packages/backend/src/core/NoteCreateService.ts | 4 ++-- packages/backend/src/core/NoteEditService.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/core/NoteCreateService.ts b/packages/backend/src/core/NoteCreateService.ts index 39c2a89387..52e8795c37 100644 --- a/packages/backend/src/core/NoteCreateService.ts +++ b/packages/backend/src/core/NoteCreateService.ts @@ -810,7 +810,7 @@ export class NoteCreateService implements OnApplicationShutdown { const muted = isUserRelated(note, userIdsWhoMeMuting); - if (!isThreadMuted || !muted) { + if (!isThreadMuted && !muted) { nm.push(data.reply.userId, 'reply'); this.globalEventService.publishMainStream(data.reply.userId, 'reply', noteObj); @@ -845,7 +845,7 @@ export class NoteCreateService implements OnApplicationShutdown { const muted = isUserRelated(note, userIdsWhoMeMuting); - if (!isThreadMuted || !muted) { + if (!isThreadMuted && !muted) { nm.push(data.renote.userId, type); } } diff --git a/packages/backend/src/core/NoteEditService.ts b/packages/backend/src/core/NoteEditService.ts index d7a79920eb..bfadb1d18d 100644 --- a/packages/backend/src/core/NoteEditService.ts +++ b/packages/backend/src/core/NoteEditService.ts @@ -627,7 +627,7 @@ export class NoteEditService implements OnApplicationShutdown { const muted = isUserRelated(note, userIdsWhoMeMuting); - if (!isThreadMuted || !muted) { + if (!isThreadMuted && !muted) { nm.push(data.reply.userId, 'reply'); this.globalEventService.publishMainStream(data.reply.userId, 'reply', noteObj); @@ -662,7 +662,7 @@ export class NoteEditService implements OnApplicationShutdown { const muted = isUserRelated(note, userIdsWhoMeMuting); - if (!isThreadMuted || !muted) { + if (!isThreadMuted && !muted) { nm.push(data.renote.userId, type); } }