diff --git a/src/server/api/stream/channels/global-timeline.ts b/src/server/api/stream/channels/global-timeline.ts index bfb7697ba7689d41a77d3893a45e220584e0cf68..3aaadc1a4a81e1aa97e64bcd597ba13aaf19e571 100644 --- a/src/server/api/stream/channels/global-timeline.ts +++ b/src/server/api/stream/channels/global-timeline.ts @@ -22,6 +22,8 @@ export default class extends Channel { @autobind private async onNote(note: any) { + if (note.visibility !== 'public') return; + // リプライãªã‚‰å†pack if (note.replyId != null) { note.reply = await Notes.pack(note.replyId, this.user, { diff --git a/test/streaming.ts b/test/streaming.ts index 2dfede1380f493130c556172d268526c0205aeba..6b9ef9cea5bac18f47ecd7e0694b9b16c7661677 100644 --- a/test/streaming.ts +++ b/test/streaming.ts @@ -594,6 +594,31 @@ describe('Streaming', () => { text: 'foo' }); })); + + it('ホーム投稿ã¯æµã‚Œãªã„', () => new Promise(async done => { + const alice = await signup({ username: 'alice' }); + const bob = await signup({ username: 'bob' }); + + let fired = false; + + const ws = await connectStream(alice, 'globalTimeline', ({ type, body }) => { + if (type == 'note') { + fired = true; + } + }); + + // ホーム投稿 + post(bob, { + text: 'foo', + visibility: 'home' + }); + + setTimeout(() => { + assert.strictEqual(fired, false); + ws.close(); + done(); + }, 3000); + })); }); describe('UserList Timeline', () => {