Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Merge branch 'custom-nj/develop' into custom-nj/main
Browse files Browse the repository at this point in the history
  • Loading branch information
nafu-at committed Jun 11, 2024
2 parents b714269 + 86fbbaf commit 2ebdde3
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "misskey",
"version": "2024.5.0-NJ-5.0.0",
"version": "2024.5.0-NJ-5.1.0",
"codename": "nasubi",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const meta = {
category: {
type: 'string',
nullable: false, optional: false,
}
},
},
},
},
Expand Down Expand Up @@ -107,7 +107,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private abuseUserReportEntityService: AbuseUserReportEntityService,
private queryService: QueryService,
) {
super(meta, paramDef, async (ps, me) => {
super(meta, paramDef, async (ps) => {
const query = this.queryService.makePaginationQuery(this.abuseUserReportsRepository.createQueryBuilder('report'), ps.sinceId, ps.untilId);

switch (ps.state) {
Expand All @@ -131,7 +131,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-

const reports = await query.limit(ps.limit).getMany();

return await this.abuseUserReportEntityService.packMany(reports, me);
return await this.abuseUserReportEntityService.packMany(reports);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ export const meta = {
type: 'boolean',
optional: false, nullable: false,
},
isAiGenerated: {
type: 'boolean',
optional: false, nullable: false,
},
isLink: {
type: 'boolean',
optional: false, nullable: false,
Expand Down Expand Up @@ -215,6 +219,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
maybePorn: file.maybePorn,
maybeSensitive: file.maybeSensitive,
isSensitive: file.isSensitive,
isAiGenerated: file.isAiGenerated,
folderId: file.folderId,
src: file.src,
uri: file.uri,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-

const reports = await query.limit(ps.limit).getMany();

return await this.moderationLogEntityService.packMany(reports, me);
return await this.moderationLogEntityService.packMany(reports);
});
}
}
7 changes: 7 additions & 0 deletions packages/frontend/src/components/MkMediaImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ function showMenu(ev: MouseEvent) {
action: () => {
os.apiWithDialog('drive/files/update', { fileId: props.image.id, isSensitive: true });
},
}] : []), ...(iAmModerator ? [{
text: i18n.ts.markAsAiGenerated,
icon: 'ti ti-robot',
danger: true,
action: () => {
os.apiWithDialog('drive/files/update', { fileId: props.image.id, isAiGenerated: true });
},
}] : []), ...($i?.id === props.image.userId ? [{
type: 'divider' as const,
}, {
Expand Down
10 changes: 10 additions & 0 deletions packages/frontend/src/pages/admin-file.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<div>
<MkSwitch v-model="isSensitive" @update:modelValue="toggleIsSensitive">{{ i18n.ts.sensitive }}</MkSwitch>
</div>
<div>
<MkSwitch v-model="isAiGenerated" @update:modelValue="toggleAiGenerated">{{ i18n.ts.aiGenerated }}</MkSwitch>
</div>

<div>
<MkButton danger @click="del"><i class="ti ti-trash"></i> {{ i18n.ts.delete }}</MkButton>
Expand Down Expand Up @@ -88,6 +91,7 @@ const tab = ref('overview');
const file = ref<Misskey.entities.DriveFile | null>(null);
const info = ref<Misskey.entities.AdminDriveShowFileResponse | null>(null);
const isSensitive = ref<boolean>(false);
const isAiGenerated = ref<boolean>(false);

const props = defineProps<{
fileId: string,
Expand All @@ -97,6 +101,7 @@ async function fetch() {
file.value = await misskeyApi('drive/files/show', { fileId: props.fileId });
info.value = await misskeyApi('admin/drive/show-file', { fileId: props.fileId });
isSensitive.value = file.value.isSensitive;
isAiGenerated.value = file.value.isAiGenerated;
}

fetch();
Expand All @@ -118,6 +123,11 @@ async function toggleIsSensitive(v) {
isSensitive.value = v;
}

async function toggleAiGenerated(v) {
await misskeyApi('drive/files/update', { fileId: props.fileId, isAiGenerated: v });
isAiGenerated.value = v;
}

const headerActions = computed(() => [{
text: i18n.ts.openInNewTab,
icon: 'ti ti-external-link',
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/pages/search.note.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const searchHost = ref('');
const notePagination = ref();
const user = ref<any>(null);
const isLocalOnly = ref(false);
const isAdvanced = ref($i.policies.canUseAdvancesSearch);
const isAdvanced = ref(false);

function selectUser() {
os.selectUser({ includeSelf: true }).then(_user => {
Expand Down
1 change: 1 addition & 0 deletions packages/misskey-js/src/autogen/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6563,6 +6563,7 @@ export type operations = {
*/
folderId: string | null;
isSensitive: boolean;
isAiGenerated: boolean;
isLink: boolean;
};
};
Expand Down

0 comments on commit 2ebdde3

Please sign in to comment.