feat: 絵文字のホーム通知

This commit is contained in:
mattyatea 2023-12-09 19:05:27 +09:00
parent b7f9ad1944
commit da83bc315a
6 changed files with 15 additions and 19 deletions

3
locales/index.d.ts vendored
View File

@ -282,6 +282,7 @@ export interface Locale {
"messaging": string; "messaging": string;
"upload": string; "upload": string;
"keepOriginalUploading": string; "keepOriginalUploading": string;
"isNotifyIsHome": string;
"keepOriginalUploadingDescription": string; "keepOriginalUploadingDescription": string;
"fromDrive": string; "fromDrive": string;
"fromUrl": string; "fromUrl": string;
@ -1716,8 +1717,8 @@ export interface Locale {
"gtlAvailable": string; "gtlAvailable": string;
"ltlAvailable": string; "ltlAvailable": string;
"canPublicNote": string; "canPublicNote": string;
"canScheduleNote": string;
"canEditNote": string; "canEditNote": string;
"canScheduleNote": string;
"canInvite": string; "canInvite": string;
"inviteLimit": string; "inviteLimit": string;
"inviteLimitCycle": string; "inviteLimitCycle": string;

View File

@ -279,6 +279,7 @@ saved: "保存しました"
messaging: "チャット" messaging: "チャット"
upload: "アップロード" upload: "アップロード"
keepOriginalUploading: "オリジナル画像を保持" keepOriginalUploading: "オリジナル画像を保持"
isNotifyIsHome: "ホーム投稿で通知する"
keepOriginalUploadingDescription: "画像をアップロードする時にオリジナル版を保持します。オフにするとアップロード時にブラウザでWeb公開用画像を生成します。" keepOriginalUploadingDescription: "画像をアップロードする時にオリジナル版を保持します。オフにするとアップロード時にブラウザでWeb公開用画像を生成します。"
fromDrive: "ドライブから" fromDrive: "ドライブから"
fromUrl: "URLから" fromUrl: "URLから"

View File

@ -38,6 +38,7 @@ export const paramDef = {
fileId: { type: 'string', format: 'misskey:id' }, fileId: { type: 'string', format: 'misskey:id' },
isSensitive: { type: 'boolean' }, isSensitive: { type: 'boolean' },
localOnly: { type: 'boolean' }, localOnly: { type: 'boolean' },
isNotifyIsHome: { type: 'boolean', default: false },
}, },
required: ['name', 'fileId'], required: ['name', 'fileId'],
} as const; } as const;
@ -84,6 +85,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
if (EmojiBotToken){ if (EmojiBotToken){
const data_Miss = { const data_Miss = {
'i': EmojiBotToken, 'i': EmojiBotToken,
'visibility': ps.isNotifyIsHome ? 'home' : 'public',
'text': 'text':
'絵文字名 : :' + ps.name + ':\n' + '絵文字名 : :' + ps.name + ':\n' +
'カテゴリ : ' + ps.category + '\n' + 'カテゴリ : ' + ps.category + '\n' +

View File

@ -66,9 +66,13 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkFolder> </MkFolder>
<MkSwitch v-model="isSensitive">{{ i18n.ts.isSensitive }}</MkSwitch> <MkSwitch v-model="isSensitive">{{ i18n.ts.isSensitive }}</MkSwitch>
<MkSwitch v-model="localOnly">{{ i18n.ts.localOnly }}</MkSwitch> <MkSwitch v-model="localOnly">{{ i18n.ts.localOnly }}</MkSwitch>
<MkSwitch v-if="!isRequest" v-model="draft" :disabled="isRequest"> <MkSwitch v-model="isNotifyIsHome">
{{ i18n.ts.isNotifyIsHome }}
</MkSwitch>
<MkSwitch v-if="!isRequest" v-model="draft" >
{{ i18n.ts.draft }} {{ i18n.ts.draft }}
</MkSwitch> </MkSwitch>
</div> </div>
</MkSpacer> </MkSpacer>
<div :class="$style.footer"> <div :class="$style.footer">
@ -116,6 +120,7 @@ let file = $ref<Misskey.entities.DriveFile>();
let chooseFile: DriveFile|null = $ref(null); let chooseFile: DriveFile|null = $ref(null);
let draft = $ref(props.emoji ? props.emoji.draft : false); let draft = $ref(props.emoji ? props.emoji.draft : false);
let isRequest = $ref(props.isRequest); let isRequest = $ref(props.isRequest);
let isNotifyIsHome = $ref(false);
let url; let url;
watch($$(roleIdsThatCanBeUsedThisEmojiAsReaction), async () => { watch($$(roleIdsThatCanBeUsedThisEmojiAsReaction), async () => {
@ -148,6 +153,7 @@ async function add() {
aliases: aliases.split(' '), aliases: aliases.split(' '),
license: license === '' ? null : license, license: license === '' ? null : license,
fileId: chooseFile.id, fileId: chooseFile.id,
isNotifyIsHome: isNotifyIsHome,
}); });
emit('done', { emit('done', {
@ -220,6 +226,7 @@ async function done() {
isSensitive, isSensitive,
localOnly, localOnly,
roleIdsThatCanBeUsedThisEmojiAsReaction: rolesThatCanBeUsedThisEmojiAsReaction.map(x => x.id), roleIdsThatCanBeUsedThisEmojiAsReaction: rolesThatCanBeUsedThisEmojiAsReaction.map(x => x.id),
isNotifyIsHome,
}; };
if (file) { if (file) {

View File

@ -49,7 +49,6 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="showNoteActionsOnlyHover">{{ i18n.ts.showNoteActionsOnlyHover }}</MkSwitch> <MkSwitch v-model="showNoteActionsOnlyHover">{{ i18n.ts.showNoteActionsOnlyHover }}</MkSwitch>
<MkSwitch v-model="showClipButtonInNoteFooter">{{ i18n.ts.showClipButtonInNoteFooter }}</MkSwitch> <MkSwitch v-model="showClipButtonInNoteFooter">{{ i18n.ts.showClipButtonInNoteFooter }}</MkSwitch>
<MkSwitch v-model="collapseRenotes">{{ i18n.ts.collapseRenotes }}</MkSwitch> <MkSwitch v-model="collapseRenotes">{{ i18n.ts.collapseRenotes }}</MkSwitch>
<MkSwitch v-model="hideMutedNotes">{{ i18n.ts.hideMutedNotes }}</MkSwitch>
<MkSwitch v-model="showVisibilityColor">{{ i18n.ts.showVisibilityColor}}</MkSwitch> <MkSwitch v-model="showVisibilityColor">{{ i18n.ts.showVisibilityColor}}</MkSwitch>
<MkColorInput v-if="showVisibilityColor" v-model="homeColor"> <MkColorInput v-if="showVisibilityColor" v-model="homeColor">
<template #label>{{ i18n.ts._visibility.home }}</template> <template #label>{{ i18n.ts._visibility.home }}</template>
@ -139,10 +138,8 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="useSystemFont">{{ i18n.ts.useSystemFont }}</MkSwitch> <MkSwitch v-model="useSystemFont">{{ i18n.ts.useSystemFont }}</MkSwitch>
<MkSwitch v-model="disableDrawer">{{ i18n.ts.disableDrawer }}</MkSwitch> <MkSwitch v-model="disableDrawer">{{ i18n.ts.disableDrawer }}</MkSwitch>
<MkSwitch v-model="forceShowAds">{{ i18n.ts.forceShowAds }}</MkSwitch> <MkSwitch v-model="forceShowAds">{{ i18n.ts.forceShowAds }}</MkSwitch>
<MkSwitch :disabled="enableUltimateDataSaverMode || enableCellularWithUltimateDataSaver" v-model="enableDataSaverMode">{{ i18n.ts.dataSaver }}</MkSwitch> <MkSwitch v-model="enableDataSaverMode">{{ i18n.ts.dataSaver }}</MkSwitch>
<MkSwitch :disabled="enableUltimateDataSaverMode || enableCellularWithUltimateDataSaver" v-model="enableCellularWithDataSaver">{{ i18n.ts.cellularWithDataSaver }}</MkSwitch> <MkSwitch v-model="enableCellularWithDataSaver">{{ i18n.ts.cellularWithDataSaver }}</MkSwitch>
<MkSwitch v-model="enableUltimateDataSaverMode">{{ i18n.ts.UltimateDataSaver }}</MkSwitch>
<MkSwitch v-model="enableCellularWithUltimateDataSaver">{{ i18n.ts.cellularWithUltimateDataSaver }}</MkSwitch>
<MkSwitch v-model="enableGamingMode">{{ i18n.ts.gamingMode }} <template #caption>{{ i18n.ts.gamingModeInfo }} </template></MkSwitch> <MkSwitch v-model="enableGamingMode">{{ i18n.ts.gamingMode }} <template #caption>{{ i18n.ts.gamingModeInfo }} </template></MkSwitch>
<MkSwitch v-model="enableonlyAndWithSave">{{ i18n.ts.onlyAndWithSave}}<template #caption>{{ i18n.ts.onlyAndWithSaveInfo }} </template></MkSwitch> <MkSwitch v-model="enableonlyAndWithSave">{{ i18n.ts.onlyAndWithSave}}<template #caption>{{ i18n.ts.onlyAndWithSaveInfo }} </template></MkSwitch>
<MkSwitch v-model="enablehanntenn">{{ i18n.ts.hanntenn }}<template #caption>{{ i18n.ts.hanntennInfo }} </template></MkSwitch> <MkSwitch v-model="enablehanntenn">{{ i18n.ts.hanntenn }}<template #caption>{{ i18n.ts.hanntennInfo }} </template></MkSwitch>
@ -258,7 +255,6 @@ const showClipButtonInNoteFooter = computed(defaultStore.makeGetterSetter('showC
const reactionsDisplaySize = computed(defaultStore.makeGetterSetter('reactionsDisplaySize')); const reactionsDisplaySize = computed(defaultStore.makeGetterSetter('reactionsDisplaySize'));
const limitWidthOfReaction = computed(defaultStore.makeGetterSetter('limitWidthOfReaction')); const limitWidthOfReaction = computed(defaultStore.makeGetterSetter('limitWidthOfReaction'));
const collapseRenotes = computed(defaultStore.makeGetterSetter('collapseRenotes')); const collapseRenotes = computed(defaultStore.makeGetterSetter('collapseRenotes'));
const hideMutedNotes = computed(defaultStore.makeGetterSetter('hideMutedNotes'));
const reduceAnimation = computed(defaultStore.makeGetterSetter('animation', v => !v, v => !v)); const reduceAnimation = computed(defaultStore.makeGetterSetter('animation', v => !v, v => !v));
const useBlurEffectForModal = computed(defaultStore.makeGetterSetter('useBlurEffectForModal')); const useBlurEffectForModal = computed(defaultStore.makeGetterSetter('useBlurEffectForModal'));
const useBlurEffect = computed(defaultStore.makeGetterSetter('useBlurEffect')); const useBlurEffect = computed(defaultStore.makeGetterSetter('useBlurEffect'));
@ -271,8 +267,6 @@ const disableShowingAnimatedImages = computed(defaultStore.makeGetterSetter('dis
const forceShowAds = computed(defaultStore.makeGetterSetter('forceShowAds')); const forceShowAds = computed(defaultStore.makeGetterSetter('forceShowAds'));
const loadRawImages = computed(defaultStore.makeGetterSetter('loadRawImages')); const loadRawImages = computed(defaultStore.makeGetterSetter('loadRawImages'));
const enableCellularWithDataSaver = computed(defaultStore.makeGetterSetter('enableCellularWithDataSaver')); 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 highlightSensitiveMedia = computed(defaultStore.makeGetterSetter('highlightSensitiveMedia'));
const enableDataSaverMode = computed(defaultStore.makeGetterSetter('enableDataSaverMode')); const enableDataSaverMode = computed(defaultStore.makeGetterSetter('enableDataSaverMode'));
const imageNewTab = computed(defaultStore.makeGetterSetter('imageNewTab')); const imageNewTab = computed(defaultStore.makeGetterSetter('imageNewTab'));
@ -301,7 +295,6 @@ const showMediaTimeline = computed(defaultStore.makeGetterSetter('showMediaTimel
const showGlobalTimeline = computed(defaultStore.makeGetterSetter('showGlobalTimeline')); const showGlobalTimeline = computed(defaultStore.makeGetterSetter('showGlobalTimeline'));
const showVisibilityColor = computed(defaultStore.makeGetterSetter('showVisibilityColor')) const showVisibilityColor = computed(defaultStore.makeGetterSetter('showVisibilityColor'))
const FeaturedOrNote = computed(defaultStore.makeGetterSetter('FeaturedOrNote')) const FeaturedOrNote = computed(defaultStore.makeGetterSetter('FeaturedOrNote'))
const defaultWithReplies = computed(defaultStore.makeGetterSetter('defaultWithReplies'));
const disableStreamingTimeline = computed(defaultStore.makeGetterSetter('disableStreamingTimeline')); const disableStreamingTimeline = computed(defaultStore.makeGetterSetter('disableStreamingTimeline'));
const useGroupedNotifications = computed(defaultStore.makeGetterSetter('useGroupedNotifications')); const useGroupedNotifications = computed(defaultStore.makeGetterSetter('useGroupedNotifications'));
const indicatorCounterToggle = computed(defaultStore.makeGetterSetter('indicatorCounterToggle')); const indicatorCounterToggle = computed(defaultStore.makeGetterSetter('indicatorCounterToggle'));

View File

@ -234,18 +234,10 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'device', where: 'device',
default: false, default: false,
}, },
enableUltimateDataSaverMode: {
where: 'device',
default: false,
},
enableCellularWithDataSaver: { enableCellularWithDataSaver: {
where: 'device', where: 'device',
default: false, default: false,
}, },
enableCellularWithUltimateDataSaver: {
where: 'device',
default: false,
},
disableShowingAnimatedImages: { disableShowingAnimatedImages: {
where: 'device', where: 'device',
default: window.matchMedia('(prefers-reduced-motion)').matches, default: window.matchMedia('(prefers-reduced-motion)').matches,