From da83bc315a1c23d345f325e036b6b02b624d8896 Mon Sep 17 00:00:00 2001 From: mattyatea Date: Sat, 9 Dec 2023 19:05:27 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=B5=B5=E6=96=87=E5=AD=97=E3=81=AE?= =?UTF-8?q?=E3=83=9B=E3=83=BC=E3=83=A0=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 3 ++- locales/ja-JP.yml | 1 + .../src/server/api/endpoints/admin/emoji/add-draft.ts | 2 ++ .../frontend/src/components/MkEmojiEditDialog.vue | 9 ++++++++- packages/frontend/src/pages/settings/general.vue | 11 ++--------- packages/frontend/src/store.ts | 8 -------- 6 files changed, 15 insertions(+), 19 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 25c640495e..20a7ad1a0c 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -282,6 +282,7 @@ export interface Locale { "messaging": string; "upload": string; "keepOriginalUploading": string; + "isNotifyIsHome": string; "keepOriginalUploadingDescription": string; "fromDrive": string; "fromUrl": string; @@ -1716,8 +1717,8 @@ export interface Locale { "gtlAvailable": string; "ltlAvailable": string; "canPublicNote": string; - "canScheduleNote": string; "canEditNote": string; + "canScheduleNote": string; "canInvite": string; "inviteLimit": string; "inviteLimitCycle": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 94a1790dae..9482c743e8 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -279,6 +279,7 @@ saved: "保存しました" messaging: "チャット" upload: "アップロード" keepOriginalUploading: "オリジナル画像を保持" +isNotifyIsHome: "ホーム投稿で通知する" keepOriginalUploadingDescription: "画像をアップロードする時にオリジナル版を保持します。オフにするとアップロード時にブラウザでWeb公開用画像を生成します。" fromDrive: "ドライブから" fromUrl: "URLから" diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/add-draft.ts b/packages/backend/src/server/api/endpoints/admin/emoji/add-draft.ts index d91ddfca96..978663be6b 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/add-draft.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/add-draft.ts @@ -38,6 +38,7 @@ export const paramDef = { fileId: { type: 'string', format: 'misskey:id' }, isSensitive: { type: 'boolean' }, localOnly: { type: 'boolean' }, + isNotifyIsHome: { type: 'boolean', default: false }, }, required: ['name', 'fileId'], } as const; @@ -84,6 +85,7 @@ export default class extends Endpoint { if (EmojiBotToken){ const data_Miss = { 'i': EmojiBotToken, + 'visibility': ps.isNotifyIsHome ? 'home' : 'public', 'text': '絵文字名 : :' + ps.name + ':\n' + 'カテゴリ : ' + ps.category + '\n' + diff --git a/packages/frontend/src/components/MkEmojiEditDialog.vue b/packages/frontend/src/components/MkEmojiEditDialog.vue index e7f7b7c076..0e08122ec0 100644 --- a/packages/frontend/src/components/MkEmojiEditDialog.vue +++ b/packages/frontend/src/components/MkEmojiEditDialog.vue @@ -66,9 +66,13 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.isSensitive }} {{ i18n.ts.localOnly }} - + + {{ i18n.ts.isNotifyIsHome }} + + {{ i18n.ts.draft }} +
@@ -116,6 +120,7 @@ let file = $ref(); let chooseFile: DriveFile|null = $ref(null); let draft = $ref(props.emoji ? props.emoji.draft : false); let isRequest = $ref(props.isRequest); +let isNotifyIsHome = $ref(false); let url; watch($$(roleIdsThatCanBeUsedThisEmojiAsReaction), async () => { @@ -148,6 +153,7 @@ async function add() { aliases: aliases.split(' '), license: license === '' ? null : license, fileId: chooseFile.id, + isNotifyIsHome: isNotifyIsHome, }); emit('done', { @@ -220,6 +226,7 @@ async function done() { isSensitive, localOnly, roleIdsThatCanBeUsedThisEmojiAsReaction: rolesThatCanBeUsedThisEmojiAsReaction.map(x => x.id), + isNotifyIsHome, }; if (file) { diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index fe89ce21be..a842460cab 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -49,7 +49,6 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.showNoteActionsOnlyHover }} {{ i18n.ts.showClipButtonInNoteFooter }} {{ i18n.ts.collapseRenotes }} - {{ i18n.ts.hideMutedNotes }} {{ i18n.ts.showVisibilityColor}} @@ -139,10 +138,8 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.useSystemFont }} {{ i18n.ts.disableDrawer }} {{ i18n.ts.forceShowAds }} - {{ i18n.ts.dataSaver }} - {{ i18n.ts.cellularWithDataSaver }} - {{ i18n.ts.UltimateDataSaver }} - {{ i18n.ts.cellularWithUltimateDataSaver }} + {{ i18n.ts.dataSaver }} + {{ i18n.ts.cellularWithDataSaver }} {{ i18n.ts.gamingMode }} {{ i18n.ts.onlyAndWithSave}} {{ i18n.ts.hanntenn }} @@ -258,7 +255,6 @@ const showClipButtonInNoteFooter = computed(defaultStore.makeGetterSetter('showC const reactionsDisplaySize = computed(defaultStore.makeGetterSetter('reactionsDisplaySize')); const limitWidthOfReaction = computed(defaultStore.makeGetterSetter('limitWidthOfReaction')); const collapseRenotes = computed(defaultStore.makeGetterSetter('collapseRenotes')); -const hideMutedNotes = computed(defaultStore.makeGetterSetter('hideMutedNotes')); const reduceAnimation = computed(defaultStore.makeGetterSetter('animation', v => !v, v => !v)); const useBlurEffectForModal = computed(defaultStore.makeGetterSetter('useBlurEffectForModal')); const useBlurEffect = computed(defaultStore.makeGetterSetter('useBlurEffect')); @@ -271,8 +267,6 @@ const disableShowingAnimatedImages = computed(defaultStore.makeGetterSetter('dis const forceShowAds = computed(defaultStore.makeGetterSetter('forceShowAds')); const loadRawImages = computed(defaultStore.makeGetterSetter('loadRawImages')); const enableCellularWithDataSaver = computed(defaultStore.makeGetterSetter('enableCellularWithDataSaver')); -const enableUltimateDataSaverMode = computed(defaultStore.makeGetterSetter('enableUltimateDataSaverMode')) -const enableCellularWithUltimateDataSaver = computed(defaultStore.makeGetterSetter('enableCellularWithUltimateDataSaver')); const highlightSensitiveMedia = computed(defaultStore.makeGetterSetter('highlightSensitiveMedia')); const enableDataSaverMode = computed(defaultStore.makeGetterSetter('enableDataSaverMode')); const imageNewTab = computed(defaultStore.makeGetterSetter('imageNewTab')); @@ -301,7 +295,6 @@ const showMediaTimeline = computed(defaultStore.makeGetterSetter('showMediaTimel const showGlobalTimeline = computed(defaultStore.makeGetterSetter('showGlobalTimeline')); const showVisibilityColor = computed(defaultStore.makeGetterSetter('showVisibilityColor')) const FeaturedOrNote = computed(defaultStore.makeGetterSetter('FeaturedOrNote')) -const defaultWithReplies = computed(defaultStore.makeGetterSetter('defaultWithReplies')); const disableStreamingTimeline = computed(defaultStore.makeGetterSetter('disableStreamingTimeline')); const useGroupedNotifications = computed(defaultStore.makeGetterSetter('useGroupedNotifications')); const indicatorCounterToggle = computed(defaultStore.makeGetterSetter('indicatorCounterToggle')); diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index 367948edd5..07bbc5499d 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -234,18 +234,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: false, }, - enableUltimateDataSaverMode: { - where: 'device', - default: false, - }, enableCellularWithDataSaver: { where: 'device', default: false, }, - enableCellularWithUltimateDataSaver: { - where: 'device', - default: false, - }, disableShowingAnimatedImages: { where: 'device', default: window.matchMedia('(prefers-reduced-motion)').matches,