From 1e737dbb94ac856be7cc68e834f99e0bb759cf41 Mon Sep 17 00:00:00 2001 From: ozelot Date: Sat, 4 Nov 2023 18:45:59 +0900 Subject: fix(backend): GTLの「リノートを表示」オプションが機能しないのを修正 (#12234) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(backend): GTLの「リノートを表示」オプションが機能しないのを修正 (#12233) * docs: Update changelog * Apply suggestions from code review Co-authored-by: syuilo --------- Co-authored-by: syuilo --- .../backend/src/server/api/endpoints/notes/global-timeline.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'packages/backend/src/server/api/endpoints/notes') diff --git a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts index be7557c213..68fefa5b58 100644 --- a/packages/backend/src/server/api/endpoints/notes/global-timeline.ts +++ b/packages/backend/src/server/api/endpoints/notes/global-timeline.ts @@ -87,6 +87,16 @@ export default class extends Endpoint { // eslint- if (ps.withFiles) { query.andWhere('note.fileIds != \'{}\''); } + + if (ps.withRenotes === false) { + query.andWhere(new Brackets(qb => { + qb.where('note.renoteId IS NULL'); + qb.orWhere(new Brackets(qb => { + qb.where('note.text IS NOT NULL'); + qb.orWhere('note.fileIds != \'{}\''); + })); + })); + } //#endregion const timeline = await query.limit(ps.limit).getMany(); -- cgit v1.2.3-freya