From 05d7aa0b91525e9029b1e8a638561bf125ca32cb Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Thu, 5 Jun 2025 02:34:57 -0400 Subject: additional fixes and cleanup to all note endpoints --- packages/backend/src/server/api/endpoints/notes/timeline.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'packages/backend/src/server/api/endpoints/notes/timeline.ts') diff --git a/packages/backend/src/server/api/endpoints/notes/timeline.ts b/packages/backend/src/server/api/endpoints/notes/timeline.ts index d898748ac7..8cf7bb5795 100644 --- a/packages/backend/src/server/api/endpoints/notes/timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/timeline.ts @@ -142,11 +142,6 @@ export default class extends Endpoint { // eslint- private async getFromDb(ps: { untilId: string | null; sinceId: string | null; limit: number; withFiles: boolean; withRenotes: boolean; withBots: boolean; }, me: MiLocalUser) { //#region Construct query const query = this.queryService.makePaginationQuery(this.notesRepository.createQueryBuilder('note'), ps.sinceId, ps.untilId) - .innerJoinAndSelect('note.user', 'user') - .leftJoinAndSelect('note.reply', 'reply') - .leftJoinAndSelect('note.renote', 'renote') - .leftJoinAndSelect('reply.user', 'replyUser') - .leftJoinAndSelect('renote.user', 'renoteUser') // 1. in a channel I follow, 2. my own post, 3. by a user I follow .andWhere(new Brackets(qb => this.queryService .orFollowingChannel(qb, ':meId', 'note.channelId') @@ -160,10 +155,16 @@ export default class extends Endpoint { // eslint- .orWhere('note.replyId IS NULL') // 返信ではない .orWhere('note.replyUserId = note.userId'))) .setParameters({ meId: me.id }) + .innerJoinAndSelect('note.user', 'user') + .leftJoinAndSelect('note.reply', 'reply') + .leftJoinAndSelect('note.renote', 'renote') + .leftJoinAndSelect('reply.user', 'replyUser') + .leftJoinAndSelect('renote.user', 'renoteUser') .limit(ps.limit); this.queryService.generateVisibilityQuery(query, me); this.queryService.generateBlockedHostQueryForNote(query); + this.queryService.generateSilencedUserQueryForNotes(query, me); this.queryService.generateMutedUserQueryForNotes(query, me); this.queryService.generateBlockedUserQueryForNotes(query, me); -- cgit v1.2.3-freya