feat: 리노트 공개 범위를 지정할 수 있음 (kokonect-link/cherrypick#406)

This commit is contained in:
NoriDev 2024-01-15 17:50:30 +09:00
parent cf9bf6fa0f
commit dd6685b21e
9 changed files with 67 additions and 5 deletions

View file

@ -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)
---

View file

@ -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!"

1
locales/index.d.ts vendored
View file

@ -3,6 +3,7 @@
// Do not edit this file directly.
export interface Locale {
"_lang_": string;
"forceRenoteVisibilitySelector": string;
"cherrypickLabs": string;
"cherrypickLabsDescription": string;
"copiedLink": string;

View file

@ -1,5 +1,6 @@
_lang_: "日本語"
forceRenoteVisibilitySelector: "リノートの公開範囲を指定"
cherrypickLabs: "CherryPick研究室"
cherrypickLabsDescription: "まだ開発中の機能を試してみませんか。一部の機能はちゃんと動かないかもしれません。"
copiedLink: "リンクをコピーしました!"

View file

@ -1,5 +1,6 @@
---
_lang_: "한국어"
forceRenoteVisibilitySelector: "리노트 공개 범위 지정"
cherrypickLabs: "CherryPick 실험실"
cherrypickLabsDescription: "개발 중인 기능을 사용해 보시겠어요? 아직 개발 중인 기능이므로 제대로 작동하지 않을 수 있어요."
copiedLink: "링크를 복사했어요!"

View file

@ -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()"
>
<i class="ti ti-repeat"></i>
<p v-if="note.renoteCount > 0" :class="$style.footerButtonCount">{{ note.renoteCount }}</p>

View file

@ -76,6 +76,13 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="showReplyInNotification">{{ i18n.ts.showReplyInNotification }} <span class="_beta">CherryPick</span></MkSwitch>
<MkSwitch v-model="renoteQuoteButtonSeparation">{{ i18n.ts.renoteQuoteButtonSeparation }} <span class="_beta">CherryPick</span></MkSwitch>
<MkSwitch v-model="renoteVisibilitySelection">{{ i18n.ts.showRenoteVisibilitySelector }} <span class="_beta">CherryPick</span></MkSwitch>
<MkSelect v-if="!renoteVisibilitySelection" v-model="forceRenoteVisibilitySelection">
<template #label>{{ i18n.ts.forceRenoteVisibilitySelector }}</template>
<option value="none">{{ i18n.ts.none }}</option>
<option value="public">{{ i18n.ts._visibility.public }}</option>
<option value="home">{{ i18n.ts._visibility.home }}</option>
<option value="followers">{{ i18n.ts._visibility.followers }}</option>
</MkSelect>
<MkSwitch v-model="showFixedPostFormInReplies">{{ i18n.ts.showFixedPostFormInReplies }}<template #caption>{{ i18n.ts.showFixedPostFormInRepliesDescription }}</template> <span class="_beta">CherryPick</span></MkSwitch>
<MkSwitch v-model="allMediaNoteCollapse">{{ i18n.ts.allMediaNoteCollapse }} <span class="_beta">CherryPick</span></MkSwitch>
</div>
@ -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);

View file

@ -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');
});
}
}
}

View file

@ -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,