diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-10-20 08:02:32 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-10-20 08:02:32 +0900 |
| commit | 216b20d2dbbc042c59bf421502904da468c931fb (patch) | |
| tree | 634ed05894c1fd9c8b93db725a641c117e0730c6 /packages/backend/src/server/api/stream/channels/hybrid-timeline.ts | |
| parent | clean up (diff) | |
| download | misskey-216b20d2dbbc042c59bf421502904da468c931fb.tar.gz misskey-216b20d2dbbc042c59bf421502904da468c931fb.tar.bz2 misskey-216b20d2dbbc042c59bf421502904da468c931fb.zip | |
fix(backend): 自分のフォロワー限定ノートがWebsoketに乗ってこない
Fix #12081
Diffstat (limited to 'packages/backend/src/server/api/stream/channels/hybrid-timeline.ts')
| -rw-r--r-- | packages/backend/src/server/api/stream/channels/hybrid-timeline.ts | 8 |
1 files changed, 5 insertions, 3 deletions
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 4e90912084..2722ebcd50 100644 --- a/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts +++ b/packages/backend/src/server/api/stream/channels/hybrid-timeline.ts @@ -49,6 +49,8 @@ class HybridTimelineChannel extends Channel { @bindThis private async onNote(note: Packed<'Note'>) { + const isMe = this.user!.id === note.userId; + if (this.withFiles && (note.fileIds == null || note.fileIds.length === 0)) return; // チャンネルの投稿ではなく、自分自身の投稿 または @@ -56,14 +58,14 @@ class HybridTimelineChannel extends Channel { // チャンネルの投稿ではなく、全体公開のローカルの投稿 または // フォローしているチャンネルの投稿 の場合だけ if (!( - (note.channelId == null && this.user!.id === note.userId) || + (note.channelId == null && isMe) || (note.channelId == null && Object.hasOwn(this.following, note.userId)) || (note.channelId == null && (note.user.host == null && note.visibility === 'public')) || (note.channelId != null && this.followingChannels.has(note.channelId)) )) return; if (note.visibility === 'followers') { - if (!Object.hasOwn(this.following, note.userId)) return; + if (!isMe && !Object.hasOwn(this.following, note.userId)) return; } else if (note.visibility === 'specified') { if (!note.visibleUserIds!.includes(this.user!.id)) return; } @@ -75,7 +77,7 @@ class HybridTimelineChannel extends Channel { if (note.reply && !this.following[note.userId]?.withReplies && !this.withReplies) { const reply = note.reply; // 「チャンネル接続主への返信」でもなければ、「チャンネル接続主が行った返信」でもなければ、「投稿者の投稿者自身への返信」でもない場合 - if (reply.userId !== this.user!.id && note.userId !== this.user!.id && reply.userId !== note.userId) return; + if (reply.userId !== this.user!.id && !isMe && reply.userId !== note.userId) return; } if (note.renote && note.text == null && (note.fileIds == null || note.fileIds.length === 0) && !this.withRenotes) return; |