From 1d234e10bd6b222a5ceb7e1fcda3ac01499487a7 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Thu, 12 Dec 2019 00:49:30 +0900 Subject: [PATCH] Fix #4800 (#5622) --- src/server/api/endpoints/notes/children.ts | 2 +- src/server/api/endpoints/notes/local-timeline.ts | 2 +- src/server/api/endpoints/notes/renotes.ts | 2 +- src/server/api/endpoints/notes/replies.ts | 2 +- src/server/api/endpoints/notes/search-by-tag.ts | 2 +- src/server/api/endpoints/users/notes.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/server/api/endpoints/notes/children.ts b/src/server/api/endpoints/notes/children.ts index bc8407f31c..79e1e5ea0f 100644 --- a/src/server/api/endpoints/notes/children.ts +++ b/src/server/api/endpoints/notes/children.ts @@ -66,7 +66,7 @@ export default define(meta, async (ps, user) => { })) .leftJoinAndSelect('note.user', 'user'); - if (user) generateVisibilityQuery(query, user); + generateVisibilityQuery(query, user); if (user) generateMuteQuery(query, user); const notes = await query.take(ps.limit!).getMany(); diff --git a/src/server/api/endpoints/notes/local-timeline.ts b/src/server/api/endpoints/notes/local-timeline.ts index 4149c6f900..9fae40ecb6 100644 --- a/src/server/api/endpoints/notes/local-timeline.ts +++ b/src/server/api/endpoints/notes/local-timeline.ts @@ -95,7 +95,7 @@ export default define(meta, async (ps, user) => { .andWhere('(note.visibility = \'public\') AND (note.userHost IS NULL)') .leftJoinAndSelect('note.user', 'user'); - if (user) generateVisibilityQuery(query, user); + generateVisibilityQuery(query, user); if (user) generateMuteQuery(query, user); if (ps.withFiles) { diff --git a/src/server/api/endpoints/notes/renotes.ts b/src/server/api/endpoints/notes/renotes.ts index a5db706e32..7f77f16a6a 100644 --- a/src/server/api/endpoints/notes/renotes.ts +++ b/src/server/api/endpoints/notes/renotes.ts @@ -70,7 +70,7 @@ export default define(meta, async (ps, user) => { .andWhere(`note.renoteId = :renoteId`, { renoteId: note.id }) .leftJoinAndSelect('note.user', 'user'); - if (user) generateVisibilityQuery(query, user); + generateVisibilityQuery(query, user); if (user) generateMuteQuery(query, user); const renotes = await query.take(ps.limit!).getMany(); diff --git a/src/server/api/endpoints/notes/replies.ts b/src/server/api/endpoints/notes/replies.ts index cd38d41652..7830ce7acb 100644 --- a/src/server/api/endpoints/notes/replies.ts +++ b/src/server/api/endpoints/notes/replies.ts @@ -61,7 +61,7 @@ export default define(meta, async (ps, user) => { .andWhere('note.replyId = :replyId', { replyId: ps.noteId }) .leftJoinAndSelect('note.user', 'user'); - if (user) generateVisibilityQuery(query, user); + generateVisibilityQuery(query, user); if (user) generateMuteQuery(query, user); const timeline = await query.take(ps.limit!).getMany(); diff --git a/src/server/api/endpoints/notes/search-by-tag.ts b/src/server/api/endpoints/notes/search-by-tag.ts index 7f53b26995..f4b89ff9f5 100644 --- a/src/server/api/endpoints/notes/search-by-tag.ts +++ b/src/server/api/endpoints/notes/search-by-tag.ts @@ -95,7 +95,7 @@ export default define(meta, async (ps, me) => { const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId) .leftJoinAndSelect('note.user', 'user'); - if (me) generateVisibilityQuery(query, me); + generateVisibilityQuery(query, me); if (me) generateMuteQuery(query, me); if (ps.tag) { diff --git a/src/server/api/endpoints/users/notes.ts b/src/server/api/endpoints/users/notes.ts index 49e1ab0283..f5f08dc891 100644 --- a/src/server/api/endpoints/users/notes.ts +++ b/src/server/api/endpoints/users/notes.ts @@ -133,7 +133,7 @@ export default define(meta, async (ps, me) => { .andWhere('note.userId = :userId', { userId: user.id }) .leftJoinAndSelect('note.user', 'user'); - if (me) generateVisibilityQuery(query, me); + generateVisibilityQuery(query, me); if (me) generateMuteQuery(query, me, user); if (ps.withFiles) {