From d76fceae855385ee2a9394ab69058efab169eab1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 13 Feb 2020 22:13:24 +0900 Subject: Fix #5935 --- src/server/api/endpoints/notes/local-timeline.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/server/api/endpoints/notes/local-timeline.ts') diff --git a/src/server/api/endpoints/notes/local-timeline.ts b/src/server/api/endpoints/notes/local-timeline.ts index 9fae40ecb6..71ebceb0ec 100644 --- a/src/server/api/endpoints/notes/local-timeline.ts +++ b/src/server/api/endpoints/notes/local-timeline.ts @@ -93,6 +93,18 @@ export default define(meta, async (ps, user) => { const query = makePaginationQuery(Notes.createQueryBuilder('note'), ps.sinceId, ps.untilId, ps.sinceDate, ps.untilDate) .andWhere('(note.visibility = \'public\') AND (note.userHost IS NULL)') + .andWhere(new Brackets(qb => { qb + .where(`note.replyId IS NULL`) // 返信ではない + .orWhere('note.replyUserId = :meId', { meId: user.id }) // 返信だけど自分のノートへの返信 + .orWhere(new Brackets(qb => { qb // 返信だけど自分の行った返信 + .where(`note.replyId IS NOT NULL`) + .andWhere('note.userId = :meId', { meId: user.id }); + })) + .orWhere(new Brackets(qb => { qb // 返信だけど投稿者自身への返信 + .where(`note.replyId IS NOT NULL`) + .andWhere('note.replyUserId = note.userId', { meId: user.id }); + })); + })) .leftJoinAndSelect('note.user', 'user'); generateVisibilityQuery(query, user); -- cgit v1.2.3-freya