summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2024-01-26 18:09:25 +0000
committerdakkar <dakkar@thenautilus.net>2024-01-26 18:09:25 +0000
commite93e73673ab7cc3f761eeef651295efaac3708a5 (patch)
treeb39f208d7dc8aa9e9d422dc700eccf9421d5fa30
parentnull-ify text after trimming (diff)
downloadsharkey-e93e73673ab7cc3f761eeef651295efaac3708a5.tar.gz
sharkey-e93e73673ab7cc3f761eeef651295efaac3708a5.tar.bz2
sharkey-e93e73673ab7cc3f761eeef651295efaac3708a5.zip
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
-rw-r--r--packages/backend/src/core/NoteCreateService.ts4
-rw-r--r--packages/backend/src/core/NoteEditService.ts4
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);
}
}