fix(stream): チャンネル接続主に見えないはずのノートが表示される問題を修正

This commit is contained in:
まっちゃとーにゅ 2024-01-23 23:20:34 +09:00
parent 464884c1ab
commit 1dde8653e8
No known key found for this signature in database
GPG key ID: 143DE582A97FE052
9 changed files with 60 additions and 6 deletions

View file

@ -40,6 +40,14 @@ class AntennaChannel extends Channel {
if (data.type === 'note') {
const note = await this.noteEntityService.pack(data.body.id, this.user, { detail: true });
if (note.reply) {
const reply = note.reply;
// 自分のフォローしていないユーザーの visibility: followers な投稿への返信は弾く
if (reply.visibility === 'followers' && !Object.hasOwn(this.following, reply.userId)) return;
// 自分の見ることができないユーザーの visibility: specified な投稿への返信は弾く
if (reply.visibility === 'specified' && !reply.visibleUserIds!.includes(this.user!.id)) return;
}
// 流れてきたNoteがミュートしているユーザーが関わるものだったら無視する
if (isUserRelated(note, this.userIdsWhoMeMuting)) return;
// 流れてきたNoteがブロックされているユーザーが関わるものだったら無視する