diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-09-28 11:02:01 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-09-28 11:02:01 +0900 |
| commit | ce1218a2b27cb8208019ad3697f54b459fee63bd (patch) | |
| tree | 74b021dd40da3991c0072a7a13db5527a2fab199 /packages/backend/src/server/api/endpoints | |
| parent | Merge branch 'develop' of https://github.com/misskey-dev/misskey into develop (diff) | |
| download | sharkey-ce1218a2b27cb8208019ad3697f54b459fee63bd.tar.gz sharkey-ce1218a2b27cb8208019ad3697f54b459fee63bd.tar.bz2 sharkey-ce1218a2b27cb8208019ad3697f54b459fee63bd.zip | |
enhance: ユーザーページのノート一覧でRenoteを除外できるように
Diffstat (limited to 'packages/backend/src/server/api/endpoints')
| -rw-r--r-- | packages/backend/src/server/api/endpoints/users/notes.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index 5934baef47..982fcc858a 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -42,6 +42,7 @@ export const paramDef = { properties: { userId: { type: 'string', format: 'misskey:id' }, includeReplies: { type: 'boolean', default: true }, + includeRenotes: { type: 'boolean', default: true }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, sinceId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' }, @@ -118,6 +119,16 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint- query.andWhere('note.replyId IS NULL'); } + if (ps.includeRenotes === false) { + query.andWhere(new Brackets(qb => { + qb.orWhere('note.renoteId IS NULL'); + qb.orWhere(new Brackets(qb => { + qb.orWhere('note.text IS NOT NULL'); + qb.orWhere('note.fileIds != \'{}\''); + })); + })); + } + if (ps.includeMyRenotes === false) { query.andWhere(new Brackets(qb => { qb.orWhere('note.userId != :userId', { userId: user.id }); |