From d0085f00edac5971a36ad9258c1ece9fb129fbeb Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 15 Feb 2020 21:39:38 +0900 Subject: Fix #5950 --- src/server/api/endpoints/notes/global-timeline.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/server/api/endpoints/notes/global-timeline.ts') diff --git a/src/server/api/endpoints/notes/global-timeline.ts b/src/server/api/endpoints/notes/global-timeline.ts index 15f495576c..7475c8f078 100644 --- a/src/server/api/endpoints/notes/global-timeline.ts +++ b/src/server/api/endpoints/notes/global-timeline.ts @@ -8,6 +8,7 @@ import { Notes } from '../../../../models'; import { generateMuteQuery } from '../../common/generate-mute-query'; import { activeUsersChart } from '../../../../services/chart'; import { Brackets } from 'typeorm'; +import { generateRepliesQuery } from '../../common/generate-replies-query'; export const meta = { desc: { @@ -77,21 +78,9 @@ 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\'') - .andWhere('note.replyId 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'); + generateRepliesQuery(query, user); if (user) generateMuteQuery(query, user); if (ps.withFiles) { -- cgit v1.2.3-freya