diff --git a/CHANGELOG_CHERRYPICK.md b/CHANGELOG_CHERRYPICK.md index 21eec20aa4..282ccd1e0a 100644 --- a/CHANGELOG_CHERRYPICK.md +++ b/CHANGELOG_CHERRYPICK.md @@ -29,9 +29,11 @@ Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2023xx](CHANGE Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2023xx](CHANGELOG.md#2023xx) 문서를 참고하십시오. ### Client +- Feat: 리노트 공개 범위를 지정할 수 있음 (kokonect-link/cherrypick#406) + - 이 기능은 '리노트 공개 범위 옵션 표시' 기능이 꺼져있어야 합니다. - Enhance: 빌트인 테마를 설치하려고 할 때 오류 메시지 개선 - Fix: 장식 추가로 일부 태그를 추가할 수 없음 -- Fix: 알림 위젯 필터링이 작동하지 않을 수 있음 #404 +- Fix: 알림 위젯 필터링이 작동하지 않을 수 있음 (kokonect-link/cherrypick#404) --- diff --git a/locales/en-US.yml b/locales/en-US.yml index 1746363f75..b641b79bda 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1,5 +1,6 @@ --- _lang_: "English" +forceRenoteVisibilitySelector: "Specify visibility of renote" cherrypickLabs: "CherryPick Labs" cherrypickLabsDescription: "Why not try some of the features that are still under development? Some features may not work properly." copiedLink: "The link has been copied!" diff --git a/locales/index.d.ts b/locales/index.d.ts index b5471a017a..5a5c94e4b3 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -3,6 +3,7 @@ // Do not edit this file directly. export interface Locale { "_lang_": string; + "forceRenoteVisibilitySelector": string; "cherrypickLabs": string; "cherrypickLabsDescription": string; "copiedLink": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 2feb52c5c6..ef914de6df 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1,5 +1,6 @@ _lang_: "日本語" +forceRenoteVisibilitySelector: "リノートの公開範囲を指定" cherrypickLabs: "CherryPick研究室" cherrypickLabsDescription: "まだ開発中の機能を試してみませんか。一部の機能はちゃんと動かないかもしれません。" copiedLink: "リンクをコピーしました!" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index a4faf8b383..760d5fab39 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -1,5 +1,6 @@ --- _lang_: "한국어" +forceRenoteVisibilitySelector: "리노트 공개 범위 지정" cherrypickLabs: "CherryPick 실험실" cherrypickLabsDescription: "개발 중인 기능을 사용해 보시겠어요? 아직 개발 중인 기능이므로 제대로 작동하지 않을 수 있어요." copiedLink: "링크를 복사했어요!" diff --git a/packages/frontend/src/components/MkSubNoteContent.vue b/packages/frontend/src/components/MkSubNoteContent.vue index c0a958f06f..933966b1ba 100644 --- a/packages/frontend/src/components/MkSubNoteContent.vue +++ b/packages/frontend/src/components/MkSubNoteContent.vue @@ -80,7 +80,7 @@ SPDX-License-Identifier: AGPL-3.0-only v-tooltip="i18n.ts.renote" :class="$style.footerButton" class="_button" - @click.stop="(defaultStore.state.renoteQuoteButtonSeparation && ((!defaultStore.state.renoteVisibilitySelection && !note.channel) || (note.channel && !note.channel.allowRenoteToExternal) || note.visibility === 'followers')) ? renoteOnly() : renote()" + @click.stop="defaultStore.state.renoteQuoteButtonSeparation && ((!defaultStore.state.renoteVisibilitySelection && !note.channel) || (note.channel && !note.channel.allowRenoteToExternal) || note.visibility === 'followers') ? renoteOnly() : renote()" >

{{ note.renoteCount }}

diff --git a/packages/frontend/src/pages/settings/general.vue b/packages/frontend/src/pages/settings/general.vue index 87bcf9eda3..b03600e509 100644 --- a/packages/frontend/src/pages/settings/general.vue +++ b/packages/frontend/src/pages/settings/general.vue @@ -76,6 +76,13 @@ SPDX-License-Identifier: AGPL-3.0-only {{ i18n.ts.showReplyInNotification }} CherryPick {{ i18n.ts.renoteQuoteButtonSeparation }} CherryPick {{ i18n.ts.showRenoteVisibilitySelector }} CherryPick + + + + + + + {{ i18n.ts.showFixedPostFormInReplies }} CherryPick {{ i18n.ts.allMediaNoteCollapse }} CherryPick @@ -433,6 +440,7 @@ const showingAnimatedImages = computed(defaultStore.makeGetterSetter('showingAni const allMediaNoteCollapse = computed(defaultStore.makeGetterSetter('allMediaNoteCollapse')); const nsfwOpenBehavior = computed(defaultStore.makeGetterSetter('nsfwOpenBehavior')); const renoteVisibilitySelection = computed(defaultStore.makeGetterSetter('renoteVisibilitySelection')); +const forceRenoteVisibilitySelection = computed(defaultStore.makeGetterSetter('forceRenoteVisibilitySelection')); watch(lang, () => { miLocalStorage.setItem('lang', lang.value as string); diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 2d532aa3ad..80738de3f4 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -746,8 +746,8 @@ export function getRenoteMenu(props: { // Add visibility section if ( defaultStore.state.renoteVisibilitySelection && - !['followers', 'specified'].includes(appearNote.visibility) - && (!appearNote.channel || appearNote.channel.allowRenoteToExternal) + !['followers', 'specified'].includes(appearNote.visibility) && + (!appearNote.channel || appearNote.channel.allowRenoteToExternal) ) { // renote to public if (appearNote.visibility === 'public') { @@ -873,7 +873,7 @@ export async function getRenoteOnly(props: { visibility = smallerVisibility(visibility, 'home'); } - if (!props.mock) { + if (!props.mock && defaultStore.state.renoteVisibilitySelection) { misskeyApi('notes/create', { localOnly, visibility, @@ -883,4 +883,48 @@ export async function getRenoteOnly(props: { }); } } + + // Add visibility section + if ( + !defaultStore.state.renoteVisibilitySelection && + defaultStore.state.forceRenoteVisibilitySelection !== 'none' && + !['followers', 'specified'].includes(appearNote.visibility) && + (!appearNote.channel || appearNote.channel.allowRenoteToExternal) + ) { + // renote to public + if (appearNote.visibility === 'public' && defaultStore.state.forceRenoteVisibilitySelection === 'public') { + const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly; + misskeyApi('notes/create', { + localOnly, + visibility: 'public', + renoteId: appearNote.id, + }).then(() => { + os.toast(i18n.ts.renoted, 'renote'); + }); + } + + // renote to home + if (['home', 'public'].includes(appearNote.visibility) && defaultStore.state.forceRenoteVisibilitySelection === 'home') { + const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly; + misskeyApi('notes/create', { + localOnly, + visibility: 'home', + renoteId: appearNote.id, + }).then(() => { + os.toast(i18n.ts.renoted, 'renote'); + }); + } + + // renote to followers + if (defaultStore.state.forceRenoteVisibilitySelection === 'followers') { + const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly; + misskeyApi('notes/create', { + localOnly, + visibility: 'followers', + renoteId: appearNote.id, + }).then(() => { + os.toast(i18n.ts.renoted, 'renote'); + }); + } + } } diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index ddb4224d64..8c83870831 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -556,6 +556,10 @@ export const defaultStore = markRaw(new Storage('base', { where: 'device', default: true, }, + forceRenoteVisibilitySelection: { + where: 'device', + default: 'none' as 'none' | 'public' | 'home' | 'followers', + }, showFixedPostFormInReplies: { where: 'device', default: true,