リプライ/メンションされていれば非フォロワーへのフォロワー限定でも参照可能に (#4033)

* 非メンション/リプライ投稿がmentionsにあるかどうかはvisibilityと関係ないので削除

* リプライ/メンションされていれば非フォロワーでも参照可能に
This commit is contained in:
MeiMei
2019-01-29 17:34:43 +09:00
committed by syuilo
parent 8a3e26cdb8
commit 2ed9e26a4f
4 changed files with 48 additions and 45 deletions

View File

@ -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({