diff --git a/locales/en-US.yml b/locales/en-US.yml index a8d889fc94..adc8c35476 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1134,6 +1134,7 @@ deletePasskeys: "Delete passkeys" delete2faConfirm: "This will irreversibly delete 2FA on this account. Proceed?" deletePasskeysConfirm: "This will irreversibly delete all passkeys and security keys on this account. Proceed?" inputNotMatch: "Input does not match" +addRe: "Add \"re:\" at the beginning of comment in reply to a post with a content warning" _sensitiveMediaDetection: description: "Reduces the effort of server moderation through automatically recognizing diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 523df1d576..69dbd21185 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -987,6 +987,7 @@ showWithSparkles: "タイトルをキラキラさせる" youHaveUnreadAnnouncements: "未読のお知らせがあります" neverShow: "今後表示しない" remindMeLater: "また後で" +addRe: "閲覧注意の投稿への返信で、注釈の先頭に\"re:\"を追加する" _sensitiveMediaDetection: description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てられます。サーバーの負荷が少し増えます。" diff --git a/packages/client/src/components/MkPostForm.vue b/packages/client/src/components/MkPostForm.vue index b03d6b2c38..8c619b9bbf 100644 --- a/packages/client/src/components/MkPostForm.vue +++ b/packages/client/src/components/MkPostForm.vue @@ -519,10 +519,23 @@ if (props.specified) { pushVisibleUser(props.specified); } +const addRe = (s: string) => { + if ( + !defaultStore.state.addRe || + s.trim() === "" || + s.slice(0, 3).toLowerCase() === "re:" + ) + return s; + return `re: ${s}`; +}; + // keep cw when reply if (defaultStore.state.keepCw && props.reply && props.reply.cw) { useCw = true; - cw = props.reply.cw; + cw = + props.reply.user.username === $i.username + ? props.reply.cw + : addRe(props.reply.cw); } function watchForDraft() { diff --git a/packages/client/src/pages/settings/general.vue b/packages/client/src/pages/settings/general.vue index e7a8183f3a..c17283c34b 100644 --- a/packages/client/src/pages/settings/general.vue +++ b/packages/client/src/pages/settings/general.vue @@ -71,6 +71,12 @@ {{ i18n.ts.reflectMayTakeTime }} + {{ i18n.ts.addRe + }}{{ + i18n.ts.originalFeature + }} @@ -357,6 +363,7 @@ const showAdminUpdates = computed( const showTimelineReplies = computed( defaultStore.makeGetterSetter("showTimelineReplies"), ); +const addRe = computed(defaultStore.makeGetterSetter("addRe")); watch(swipeOnDesktop, () => { defaultStore.set("swipeOnMobile", true); diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts index 25ed553070..694d2dc953 100644 --- a/packages/client/src/store.ts +++ b/packages/client/src/store.ts @@ -342,6 +342,10 @@ export const defaultStore = markRaw( where: "device", default: false, }, + addRe: { + where: "account", + default: true, + }, }), );