diff options
| author | Marie <Marie@kaifa.ch> | 2023-12-21 22:42:06 +0100 |
|---|---|---|
| committer | Marie <Marie@kaifa.ch> | 2023-12-21 22:42:06 +0100 |
| commit | 9c6a7aed98a1d37f4f1fca1898f8ca9a2a6b0ced (patch) | |
| tree | ba11c2af72b0dbd19af8b788dce826d150625dc8 /packages/backend/src/server/api | |
| parent | fix: clicking on reaction icon not triggering toggle (diff) | |
| download | sharkey-9c6a7aed98a1d37f4f1fca1898f8ca9a2a6b0ced.tar.gz sharkey-9c6a7aed98a1d37f4f1fca1898f8ca9a2a6b0ced.tar.bz2 sharkey-9c6a7aed98a1d37f4f1fca1898f8ca9a2a6b0ced.zip | |
fix: websocket for timelines not checking following for muted instance users
Closes #233
Diffstat (limited to 'packages/backend/src/server/api')
4 files changed, 4 insertions, 4 deletions
diff --git a/packages/backend/src/server/api/stream/channels/bubble-timeline.ts b/packages/backend/src/server/api/stream/channels/bubble-timeline.ts index 74d5c3ea4e..1a3fcede62 100644 --- a/packages/backend/src/server/api/stream/channels/bubble-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/bubble-timeline.ts @@ -71,7 +71,7 @@ class BubbleTimelineChannel extends Channel { if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return; // Ignore notes from instances the user has muted - if (isInstanceMuted(note, new Set<string>(this.userProfile?.mutedInstances ?? []))) return; + if (isInstanceMuted(note, new Set<string>(this.userProfile?.mutedInstances ?? [])) && !this.following[note.userId]) return; // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する if (isUserRelated(note, this.userIdsWhoMeMuting)) return; diff --git a/packages/backend/src/server/api/stream/channels/global-timeline.ts b/packages/backend/src/server/api/stream/channels/global-timeline.ts index fa0493854b..f64a13bcc5 100644 --- a/packages/backend/src/server/api/stream/channels/global-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/global-timeline.ts @@ -67,7 +67,7 @@ class GlobalTimelineChannel extends Channel { if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return; // Ignore notes from instances the user has muted - if (isInstanceMuted(note, new Set<string>(this.userProfile?.mutedInstances ?? []))) return; + if (isInstanceMuted(note, new Set<string>(this.userProfile?.mutedInstances ?? [])) && !this.following[note.userId]) return; // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する if (isUserRelated(note, this.userIdsWhoMeMuting)) return; diff --git a/packages/backend/src/server/api/stream/channels/home-timeline.ts b/packages/backend/src/server/api/stream/channels/home-timeline.ts index 32bb9fd984..534973f834 100644 --- a/packages/backend/src/server/api/stream/channels/home-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts @@ -51,7 +51,7 @@ class HomeTimelineChannel extends Channel { } // Ignore notes from instances the user has muted - if (isInstanceMuted(note, new Set<string>(this.userProfile!.mutedInstances))) return; + if (isInstanceMuted(note, new Set<string>(this.userProfile!.mutedInstances)) && !this.following[note.userId]) return; if (note.visibility === 'followers') { if (!isMe && !Object.hasOwn(this.following, note.userId)) return; diff --git a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts index cf904b475a..746c661d31 100644 --- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts @@ -74,7 +74,7 @@ class HybridTimelineChannel extends Channel { } // Ignore notes from instances the user has muted - if (isInstanceMuted(note, new Set<string>(this.userProfile!.mutedInstances))) return; + if (isInstanceMuted(note, new Set<string>(this.userProfile!.mutedInstances)) && !this.following[note.userId]) return; if (note.reply) { const reply = note.reply; |