From dd777935cb840d76ab09357c92f5145ad20c2b28 Mon Sep 17 00:00:00 2001 From: April John Date: Fri, 5 May 2023 15:53:05 +0200 Subject: [PATCH] fix: dont stream hidden posts over websocket --- packages/backend/src/server/api/stream/channels/home-timeline.ts | 1 + .../src/server/api/stream/channels/recommended-timeline.ts | 1 + packages/backend/src/server/api/stream/channels/user-list.ts | 1 + 3 files changed, 3 insertions(+) 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 fa4a8a390..59501bafa 100644 --- a/packages/backend/src/server/api/stream/channels/home-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/home-timeline.ts @@ -20,6 +20,7 @@ export default class extends Channel { } private async onNote(note: Packed<"Note">) { + if (note.visibility === "hidden") return; if (note.channelId) { if (!this.followingChannels.has(note.channelId)) return; } else { diff --git a/packages/backend/src/server/api/stream/channels/recommended-timeline.ts b/packages/backend/src/server/api/stream/channels/recommended-timeline.ts index 6baec7744..37e29cd9a 100644 --- a/packages/backend/src/server/api/stream/channels/recommended-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/recommended-timeline.ts @@ -29,6 +29,7 @@ export default class extends Channel { } private async onNote(note: Packed<"Note">) { + if (note.visibility === "hidden") return; // チャンネルの投稿ではなく、自分自身の投稿 または // チャンネルの投稿ではなく、その投稿のユーザーをフォローしている または // チャンネルの投稿ではなく、全体公開のローカルの投稿 または diff --git a/packages/backend/src/server/api/stream/channels/user-list.ts b/packages/backend/src/server/api/stream/channels/user-list.ts index 105c45955..c2b62c05a 100644 --- a/packages/backend/src/server/api/stream/channels/user-list.ts +++ b/packages/backend/src/server/api/stream/channels/user-list.ts @@ -49,6 +49,7 @@ export default class extends Channel { } private async onNote(note: Packed<"Note">) { + if (note.visibility === "hidden") return; if (!this.listUsers.includes(note.userId)) return; // 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する