diff --git a/CHANGELOG.md b/CHANGELOG.md index 995c361f15..af2370f3ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ - Enhance: 未読の通知数を表示できるように - Enhance: ローカリゼーションの更新 - Enhance: 依存関係の更新 +- Change: CWを使用する場合、注釈を空にすることは許可されなくなりました ### Client - Feat: プラグイン・テーマを外部サイトから直接インストールできるようになりました diff --git a/locales/index.d.ts b/locales/index.d.ts index 995bca9cff..31cf84861d 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -1158,6 +1158,7 @@ export interface Locale { "pullDownToRefresh": string; "disableStreamingTimeline": string; "useGroupedNotifications": string; + "cwNotationRequired": string; "_announcement": { "forExistingUsers": string; "forExistingUsersDescription": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 420b538a4a..69a48fc672 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1155,6 +1155,7 @@ refreshing: "リロード中" pullDownToRefresh: "引っ張ってリロード" disableStreamingTimeline: "タイムラインのリアルタイム更新を無効にする" useGroupedNotifications: "通知をグルーピングして表示する" +cwNotationRequired: "「内容を隠す」がオンの場合は注釈の記述が必要です。" _announcement: forExistingUsers: "既存ユーザーのみ" diff --git a/packages/backend/src/server/api/endpoints/notes/create.ts b/packages/backend/src/server/api/endpoints/notes/create.ts index 649068fb20..fb650f69ff 100644 --- a/packages/backend/src/server/api/endpoints/notes/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/create.ts @@ -16,8 +16,8 @@ import { Endpoint } from '@/server/api/endpoint-base.js'; import { NoteEntityService } from '@/core/entities/NoteEntityService.js'; import { NoteCreateService } from '@/core/NoteCreateService.js'; import { DI } from '@/di-symbols.js'; -import { ApiError } from '../../error.js'; import { isPureRenote } from '@/misc/is-pure-renote.js'; +import { ApiError } from '../../error.js'; export const meta = { tags: ['notes'], @@ -109,7 +109,7 @@ export const paramDef = { visibleUserIds: { type: 'array', uniqueItems: true, items: { type: 'string', format: 'misskey:id', } }, - cw: { type: 'string', nullable: true, maxLength: 100 }, + cw: { type: 'string', nullable: true, minLength: 1, maxLength: 100 }, localOnly: { type: 'boolean', default: false }, reactionAcceptance: { type: 'string', nullable: true, enum: [null, 'likeOnly', 'likeOnlyForRemote', 'nonSensitiveOnly', 'nonSensitiveOnlyForLocalLikeOnlyForRemote'], default: null }, noExtractMentions: { type: 'boolean', default: false }, diff --git a/packages/frontend/src/components/MkDrive.file.vue b/packages/frontend/src/components/MkDrive.file.vue index 96704996f9..b46b25eba2 100644 --- a/packages/frontend/src/components/MkDrive.file.vue +++ b/packages/frontend/src/components/MkDrive.file.vue @@ -47,6 +47,7 @@ import { i18n } from '@/i18n.js'; import { $i } from '@/account.js'; import { useRouter } from '@/router.js'; import { getDriveFileMenu } from '@/scripts/get-drive-file-menu.js'; +import { deviceKind } from '@/scripts/device-kind.js'; const router = useRouter(); @@ -74,7 +75,11 @@ function onClick(ev: MouseEvent) { if (props.selectMode) { emit('chosen', props.file); } else { - router.push(`/my/drive/file/${props.file.id}`); + if (deviceKind === 'desktop') { + router.push(`/my/drive/file/${props.file.id}`); + } else { + os.popupMenu(getDriveFileMenu(props.file, props.folder), (ev.currentTarget ?? ev.target ?? undefined) as HTMLElement | undefined); + } } } diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 62ff42f990..46faae9523 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -674,6 +674,14 @@ function deleteDraft() { } async function post(ev?: MouseEvent) { + if (useCw && (cw == null || cw.trim() === '')) { + os.alert({ + type: 'error', + text: i18n.ts.cwNotationRequired, + }); + return; + } + if (ev) { const el = ev.currentTarget ?? ev.target; const rect = el.getBoundingClientRect(); diff --git a/packages/frontend/src/components/global/MkAcct.vue b/packages/frontend/src/components/global/MkAcct.vue index 42d29db488..594494f3c8 100644 --- a/packages/frontend/src/components/global/MkAcct.vue +++ b/packages/frontend/src/components/global/MkAcct.vue @@ -17,7 +17,6 @@ SPDX-License-Identifier: AGPL-3.0-only