Compare commits

...

2 commits

Author SHA1 Message Date
syuilo f881465f4a Update CHANGELOG.md 2024-08-19 14:05:02 +09:00
syuilo 7246e6ff5b wip 2024-08-19 14:03:39 +09:00
3 changed files with 22 additions and 2 deletions

View file

@ -1,7 +1,7 @@
## Unreleased
### General
-
- Enhance: ハイライトからセンシティブなメディアを含むノートを除外するオプション
### Client
-

View file

@ -36,6 +36,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;
@ -103,7 +104,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // 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;
});
}
}

View file

@ -7,9 +7,11 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSpacer :contentMax="800">
<MkTab v-model="tab" style="margin-bottom: var(--margin);">
<option value="notes">{{ i18n.ts.notes }}</option>
<option value="notesWithSensitive">{{ i18n.ts.notes }} (+{{ i18n.ts.sensitive }})</option>
<option value="polls">{{ i18n.ts.poll }}</option>
</MkTab>
<MkNotes v-if="tab === 'notes'" :pagination="paginationForNotes"/>
<MkNotes v-else-if="tab === 'notesWithSensitive'" :pagination="paginationForNotesWithSensitive"/>
<MkNotes v-else-if="tab === 'polls'" :pagination="paginationForPolls"/>
</MkSpacer>
</template>
@ -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 = {