From 2ed9e26a4fc6ece9b510538ac6c48a62eb8536d1 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Tue, 29 Jan 2019 17:34:43 +0900 Subject: リプライ/メンションされていれば非フォロワーへのフォロワー限定でも参照可能に (#4033) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 非メンション/リプライ投稿がmentionsにあるかどうかはvisibilityと関係ないので削除 * リプライ/メンションされていれば非フォロワーでも参照可能に --- src/models/note.ts | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/models') diff --git a/src/models/note.ts b/src/models/note.ts index 8ca65bb423..a872eb7696 100644 --- a/src/models/note.ts +++ b/src/models/note.ts @@ -140,6 +140,12 @@ export const hideNote = async (packedNote: any, meId: mongo.ObjectID) => { hide = true; } else if (meId.equals(packedNote.userId)) { hide = false; + } else if (packedNote.reply && meId.equals(packedNote.reply.userId)) { + // 自分の投稿に対するリプライ + hide = false; + } else if (packedNote.mentions && packedNote.mentions.some((id: any) => meId.equals(id))) { + // 自分へのメンション + hide = false; } else { // フォロワーかどうか const following = await Following.findOne({ -- cgit v1.2.3-freya