diff --git a/CHANGELOG.md b/CHANGELOG.md index 1924805849..9f862f40cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - DockerのNode.jsが22.15.0に更新されました ### General -- +- Enhance: ハイライトからセンシティブなメディアを含むノートを除外するオプション ### Client - Feat: マウスでもタイムラインを引っ張って更新できるように diff --git a/packages/backend/src/server/api/endpoints/notes/featured.ts b/packages/backend/src/server/api/endpoints/notes/featured.ts index a57c84d432..dfb67d9ced 100644 --- a/packages/backend/src/server/api/endpoints/notes/featured.ts +++ b/packages/backend/src/server/api/endpoints/notes/featured.ts @@ -37,6 +37,7 @@ export const paramDef = { limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, untilId: { type: 'string', format: 'misskey:id' }, channelId: { type: 'string', nullable: true, format: 'misskey:id' }, + withSensitive: { type: 'boolean', default: true }, }, required: [], } as const; @@ -108,7 +109,13 @@ export default class extends Endpoint { // eslint- notes.sort((a, b) => a.id > b.id ? -1 : 1); - return await this.noteEntityService.packMany(notes, me); + let packed = await this.noteEntityService.packMany(notes, me); + + if (!ps.withSensitive) { + packed = packed.filter(note => note.files?.length === 0 || note.files?.every(file => !file.isSensitive)); + } + + return packed; }); } } diff --git a/packages/frontend/src/pages/explore.featured.vue b/packages/frontend/src/pages/explore.featured.vue index a47e3efbc8..aabf7f4aaf 100644 --- a/packages/frontend/src/pages/explore.featured.vue +++ b/packages/frontend/src/pages/explore.featured.vue @@ -7,9 +7,11 @@ SPDX-License-Identifier: AGPL-3.0-only
+ +
@@ -23,6 +25,17 @@ import { i18n } from '@/i18n.js'; const paginationForNotes = { endpoint: 'notes/featured' as const, limit: 10, + params: { + withSensitive: false, + }, +}; + +const paginationForNotesWithSensitive = { + endpoint: 'notes/featured' as const, + limit: 10, + params: { + withSensitive: true, + }, }; const paginationForPolls = {