diff --git a/packages/backend/src/server/api/endpoints/users/notes.ts b/packages/backend/src/server/api/endpoints/users/notes.ts index 56983f7bc45c..365247f8562e 100644 --- a/packages/backend/src/server/api/endpoints/users/notes.ts +++ b/packages/backend/src/server/api/endpoints/users/notes.ts @@ -45,6 +45,7 @@ export const paramDef = { userId: { type: 'string', format: 'misskey:id' }, withReplies: { type: 'boolean', default: false }, withRenotes: { type: 'boolean', default: true }, + withSpecified: { type: 'boolean', default: true }, withChannelNotes: { type: 'boolean', default: false }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, sinceId: { type: 'string', format: 'misskey:id' }, @@ -86,6 +87,7 @@ export default class extends Endpoint { // eslint- withChannelNotes: ps.withChannelNotes, withFiles: ps.withFiles, withRenotes: ps.withRenotes, + withSpecified: ps.withSpecified }, me); return await this.noteEntityService.packMany(timeline, me); @@ -122,7 +124,7 @@ export default class extends Endpoint { // eslint- } if (note.channel?.isSensitive && !isSelf) return false; - if (note.visibility === 'specified' && (!me || (me.id !== note.userId && !note.visibleUserIds.some(v => v === me.id)))) return false; + if (note.visibility === 'specified' && (!ps.withSpecified || !me || (me.id !== note.userId && !note.visibleUserIds.some(v => v === me.id)))) return false; if (note.visibility === 'followers' && !isFollowing && !isSelf) return false; return true; @@ -134,7 +136,9 @@ export default class extends Endpoint { // eslint- userId: ps.userId, withChannelNotes: ps.withChannelNotes, withFiles: ps.withFiles, + withSpecified: ps.withSpecified, withRenotes: ps.withRenotes, + withSpecified: ps.withSpecified, }, me), }); @@ -150,6 +154,7 @@ export default class extends Endpoint { // eslint- withChannelNotes: boolean, withFiles: boolean, withRenotes: boolean, + withSpecified: boolean, }, me: MiLocalUser | null) { const isSelf = me && (me.id === ps.userId); @@ -181,6 +186,10 @@ export default class extends Endpoint { // eslint- query.andWhere('note.fileIds != \'{}\''); } + if (!ps.withSpecified) { + query.andWhere('note.visibility != \'specified\''); + } + if (ps.withRenotes === false) { query.andWhere(new Brackets(qb => { qb.orWhere('note.userId != :userId', { userId: ps.userId }); diff --git a/packages/frontend/src/pages/user/index.timeline.vue b/packages/frontend/src/pages/user/index.timeline.vue index 6cf5bcf91ff3..2845067a7479 100644 --- a/packages/frontend/src/pages/user/index.timeline.vue +++ b/packages/frontend/src/pages/user/index.timeline.vue @@ -39,6 +39,7 @@ const pagination = { withRenotes: include.value === 'all', withReplies: include.value === 'all', withChannelNotes: include.value === 'all', + withSpecified: include.value === 'all', withFiles: include.value === 'files', })), };