From 434883be1eb68b99cdf8689449a68011851c13f2 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 bc8407f31..79e1e5ea0 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 4149c6f90..9fae40ecb 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 a5db706e3..7f77f16a6 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 cd38d4165..7830ce7ac 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 7f53b2699..f4b89ff9f 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 49e1ab028..f5f08dc89 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) {