Merge f881465f4a
into d522d1bf26
This commit is contained in:
commit
3e29d7560a
|
@ -4,7 +4,7 @@
|
||||||
- DockerのNode.jsが22.15.0に更新されました
|
- DockerのNode.jsが22.15.0に更新されました
|
||||||
|
|
||||||
### General
|
### General
|
||||||
-
|
- Enhance: ハイライトからセンシティブなメディアを含むノートを除外するオプション
|
||||||
|
|
||||||
### Client
|
### Client
|
||||||
- Feat: マウスでもタイムラインを引っ張って更新できるように
|
- Feat: マウスでもタイムラインを引っ張って更新できるように
|
||||||
|
|
|
@ -37,6 +37,7 @@ export const paramDef = {
|
||||||
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
|
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
|
||||||
untilId: { type: 'string', format: 'misskey:id' },
|
untilId: { type: 'string', format: 'misskey:id' },
|
||||||
channelId: { type: 'string', nullable: true, format: 'misskey:id' },
|
channelId: { type: 'string', nullable: true, format: 'misskey:id' },
|
||||||
|
withSensitive: { type: 'boolean', default: true },
|
||||||
},
|
},
|
||||||
required: [],
|
required: [],
|
||||||
} as const;
|
} as const;
|
||||||
|
@ -108,7 +109,13 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
|
|
||||||
notes.sort((a, b) => a.id > b.id ? -1 : 1);
|
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;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<div class="_spacer" style="--MI_SPACER-w: 800px;">
|
<div class="_spacer" style="--MI_SPACER-w: 800px;">
|
||||||
<MkTab v-model="tab" style="margin-bottom: var(--MI-margin);">
|
<MkTab v-model="tab" style="margin-bottom: var(--MI-margin);">
|
||||||
<option value="notes">{{ i18n.ts.notes }}</option>
|
<option value="notes">{{ i18n.ts.notes }}</option>
|
||||||
|
<option value="notesWithSensitive">{{ i18n.ts.notes }} (+{{ i18n.ts.sensitive }})</option>
|
||||||
<option value="polls">{{ i18n.ts.poll }}</option>
|
<option value="polls">{{ i18n.ts.poll }}</option>
|
||||||
</MkTab>
|
</MkTab>
|
||||||
<MkNotes v-if="tab === 'notes'" :pagination="paginationForNotes"/>
|
<MkNotes v-if="tab === 'notes'" :pagination="paginationForNotes"/>
|
||||||
|
<MkNotes v-else-if="tab === 'notesWithSensitive'" :pagination="paginationForNotesWithSensitive"/>
|
||||||
<MkNotes v-else-if="tab === 'polls'" :pagination="paginationForPolls"/>
|
<MkNotes v-else-if="tab === 'polls'" :pagination="paginationForPolls"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -23,6 +25,17 @@ import { i18n } from '@/i18n.js';
|
||||||
const paginationForNotes = {
|
const paginationForNotes = {
|
||||||
endpoint: 'notes/featured' as const,
|
endpoint: 'notes/featured' as const,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
|
params: {
|
||||||
|
withSensitive: false,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const paginationForNotesWithSensitive = {
|
||||||
|
endpoint: 'notes/featured' as const,
|
||||||
|
limit: 10,
|
||||||
|
params: {
|
||||||
|
withSensitive: true,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const paginationForPolls = {
|
const paginationForPolls = {
|
||||||
|
|
Loading…
Reference in New Issue