summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/notes/timeline.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/api/endpoints/notes/timeline.ts')
-rw-r--r--src/server/api/endpoints/notes/timeline.ts14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/server/api/endpoints/notes/timeline.ts b/src/server/api/endpoints/notes/timeline.ts
index 68a5784d93..2c25fbc968 100644
--- a/src/server/api/endpoints/notes/timeline.ts
+++ b/src/server/api/endpoints/notes/timeline.ts
@@ -7,6 +7,7 @@ import { generateVisibilityQuery } from '../../common/generate-visibility-query'
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: {
@@ -110,21 +111,10 @@ export default define(meta, async (ps, user) => {
.where(`note.userId IN (${ followingQuery.getQuery() })`)
.orWhere('note.userId = :meId', { meId: user.id });
}))
- .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')
.setParameters(followingQuery.getParameters());
+ generateRepliesQuery(query, user);
generateVisibilityQuery(query, user);
generateMuteQuery(query, user);