This commit is contained in:
무라쿠모 2024-07-20 22:31:27 +09:00
parent 7d4383c449
commit b04ffe870b
No known key found for this signature in database
GPG key ID: 139D6573F92DA9F7
5 changed files with 125 additions and 9 deletions

58
locales/index.d.ts vendored
View file

@ -5095,6 +5095,22 @@ export interface Locale extends ILocale {
* *
*/ */
"credits": string; "credits": string;
/**
*
*/
"timeWillCome": string;
/**
*
*/
"thankYou": string;
/**
*
*/
"hideSensitiveInformation": string;
/**
* '' .
*/
"youAreHidingSensitiveInformation": string;
"_bubbleGame": { "_bubbleGame": {
/** /**
* *
@ -10377,6 +10393,48 @@ export interface Locale extends ILocale {
*/ */
"nRequests": ParameterizedString<"n">; "nRequests": ParameterizedString<"n">;
}; };
"_hideSensitiveInformation": {
/**
*
*/
"use": string;
/**
*
*/
"about": string;
/**
*
*/
"itsHidden": string;
/**
*
*/
"itsNotHidden": string;
/**
*
*/
"directMessages": string;
/**
*
*/
"directMessagesUse": string;
/**
*
*/
"directMessagesDescription": string;
/**
*
*/
"moderationLog": string;
/**
*
*/
"moderationLogUse": string;
/**
*
*/
"moderationLogDescription": string;
};
} }
declare const locales: { declare const locales: {
[lang: string]: Locale; [lang: string]: Locale;

View file

@ -1271,6 +1271,8 @@ here: "こちら"
credits: "スタッフロール" credits: "スタッフロール"
timeWillCome: "いつかこの欄にあなたの名前が書かれる日が来るのでしょうか?" timeWillCome: "いつかこの欄にあなたの名前が書かれる日が来るのでしょうか?"
thankYou: "オスカーはあなたと一緒にサーフィンします。 いつまでも。" thankYou: "オスカーはあなたと一緒にサーフィンします。 いつまでも。"
hideSensitiveInformation: "민감한 정보 숨기기"
youAreHidingSensitiveInformation: "이 노트는 ''에 의해 숨겨졌습니다."
_bubbleGame: _bubbleGame:
howToPlay: "遊び方" howToPlay: "遊び方"
@ -2762,3 +2764,15 @@ _skebStatus:
yenX: "{x}円" yenX: "{x}円"
nWorks: "納品実績 {n}件" nWorks: "納品実績 {n}件"
nRequests: "取引実績 {n}件" nRequests: "取引実績 {n}件"
_hideSensitiveInformation:
use: ""
about: ""
itsHidden: "숨겨짐"
itsNotHidden: "표시됨"
directMessages: ""
directMessagesUse: ""
directMessagesDescription: ""
moderationLog: ""
moderationLogUse: ""
moderationLogDescription: ""

View file

@ -128,7 +128,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<button v-if="defaultStore.state.showClipButtonInNoteFooter" ref="clipButton" :class="$style.footerButton" class="_button" @mousedown="clip()"> <button v-if="defaultStore.state.showClipButtonInNoteFooter" ref="clipButton" :class="$style.footerButton" class="_button" @mousedown="clip()">
<i class="ti ti-paperclip"></i> <i class="ti ti-paperclip"></i>
</button> </button>
<button v-if="defaultStore.state.showTranslateButtonInNoteFooter" ref="translateButton" :class="$style.footerButton" class="_button" @mousedown="translate()"> <button v-if="defaultStore.state.showTranslateButtonInNoteFooter && $i?.policies.canUseTranslator" ref="translateButton" :class="$style.footerButton" class="_button" @mousedown="translate()">
<i class="ti ti-language-hiragana"></i> <i class="ti ti-language-hiragana"></i>
</button> </button>
<button ref="menuButton" :class="$style.footerButton" class="_button" @mousedown="showMenu()"> <button ref="menuButton" :class="$style.footerButton" class="_button" @mousedown="showMenu()">
@ -196,7 +196,7 @@ import MkRippleEffect from '@/components/MkRippleEffect.vue';
import { showMovedDialog } from '@/scripts/show-moved-dialog.js'; import { showMovedDialog } from '@/scripts/show-moved-dialog.js';
import { shouldCollapsed } from '@/scripts/collapsed.js'; import { shouldCollapsed } from '@/scripts/collapsed.js';
import { isEnabledUrlPreview } from '@/instance.js'; import { isEnabledUrlPreview } from '@/instance.js';
import { miLocalStorage } from "@/local-storage.js"; import { miLocalStorage } from '@/local-storage.js';
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
note: Misskey.entities.Note; note: Misskey.entities.Note;
@ -247,6 +247,11 @@ const isRenote = (
note.value.fileIds && note.value.fileIds.length === 0 && note.value.fileIds && note.value.fileIds.length === 0 &&
note.value.poll == null note.value.poll == null
); );
const isRedacted = (
defaultStore.state.hideDirectMessages &&
defaultStore.state.hideSensitiveInformation &&
note.value.visibility === 'specified'
);
const rootEl = shallowRef<HTMLElement>(); const rootEl = shallowRef<HTMLElement>();
const menuButton = shallowRef<HTMLElement>(); const menuButton = shallowRef<HTMLElement>();

View file

@ -46,7 +46,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<FormSection> <FormSection>
<div class="_gaps_m"> <div class="_gaps_m">
<MkSwitch v-model="rememberNoteVisibility" @update:modelValue="save()">{{ i18n.ts.rememberNoteVisibility }}</MkSwitch> <MkSwitch v-model="rememberNoteVisibility">{{ i18n.ts.rememberNoteVisibility }}</MkSwitch>
<MkFolder v-if="!rememberNoteVisibility"> <MkFolder v-if="!rememberNoteVisibility">
<template #label>{{ i18n.ts.defaultNoteVisibility }}</template> <template #label>{{ i18n.ts.defaultNoteVisibility }}</template>
<template v-if="defaultNoteVisibility === 'public'" #suffix>{{ i18n.ts._visibility.public }}</template> <template v-if="defaultNoteVisibility === 'public'" #suffix>{{ i18n.ts._visibility.public }}</template>
@ -72,13 +72,46 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #label>{{ i18n.ts.hideSensitiveInformation }}</template> <template #label>{{ i18n.ts.hideSensitiveInformation }}</template>
<div class="_gaps_m"> <div class="_gaps_m">
<MkSwitch v-model="hideDirectMessages"> <MkSwitch v-model="hideSensitiveInformation">
{{ i18n.ts.flagAsCat }} {{ i18n.ts._hideSensitiveInformation.use }}
<template #caption>{{ i18n.ts.flagAsCatDescription }}</template> <template #caption>{{ i18n.ts._hideSensitiveInformation.about }}</template>
</MkSwitch> </MkSwitch>
</div> <MkFolder v-if="hideSensitiveInformation">
<div class="_gaps_m"> <template #label>{{ i18n.ts._hideSensitiveInformation.directMessages }}</template>
<template v-if="hideDirectMessages" #suffix>{{ i18n.ts._hideSensitiveInformation.itsHidden }}</template>
<template v-else #suffix>{{ i18n.ts._hideSensitiveInformation.itsNotHidden }}</template>
<MkSwitch v-model="hideDirectMessages">
{{ i18n.ts._hideSensitiveInformation.directMessagesUse }}
<template #caption>{{ i18n.ts._hideSensitiveInformation.directMessagesDescription }}</template>
</MkSwitch>
</MkFolder>
<MkFolder v-if="hideSensitiveInformation">
<template #label>{{ i18n.ts._hideSensitiveInformation.drive }}</template>
<template v-if="hideDirectMessages" #suffix>{{ i18n.ts._hideSensitiveInformation.itsHidden }}</template>
<template v-else #suffix>{{ i18n.ts._hideSensitiveInformation.itsNotHidden }}</template>
<MkSwitch v-model="hideDirectMessages">
{{ i18n.ts._hideSensitiveInformation.driveUse }}
<template #caption>{{ i18n.ts._hideSensitiveInformation.driveDescription }}</template>
</MkSwitch>
</MkFolder>
<MkFolder v-if="hideSensitiveInformation && $i.isModerator">
<template #label>{{ i18n.ts._hideSensitiveInformation.moderationLog }}</template>
<template v-if="hideDirectMessages" #suffix>{{ i18n.ts._hideSensitiveInformation.itsHidden }}</template>
<template v-else #suffix>{{ i18n.ts._hideSensitiveInformation.itsNotHidden }}</template>
<MkSwitch v-model="hideDirectMessages">
{{ i18n.ts._hideSensitiveInformation.moderationLogUse }}
<template #caption>{{ i18n.ts._hideSensitiveInformation.moderationLogDescription }}</template>
</MkSwitch>
</MkFolder>
<MkFolder v-if="hideSensitiveInformation && $i.isModerator">
<template #label>{{ i18n.ts._hideSensitiveInformation.roles }}</template>
<template v-if="hideDirectMessages" #suffix>{{ i18n.ts._hideSensitiveInformation.itsHidden }}</template>
<template v-else #suffix>{{ i18n.ts._hideSensitiveInformation.itsNotHidden }}</template>
<MkSwitch v-model="hideDirectMessages">
{{ i18n.ts._hideSensitiveInformation.rolesUse }}
<template #caption>{{ i18n.ts._hideSensitiveInformation.rolesDescription }}</template>
</MkSwitch>
</MkFolder>
</div> </div>
</FormSection> </FormSection>
</div> </div>
@ -112,6 +145,7 @@ const defaultNoteVisibility = computed(defaultStore.makeGetterSetter('defaultNot
const defaultNoteLocalOnly = computed(defaultStore.makeGetterSetter('defaultNoteLocalOnly')); const defaultNoteLocalOnly = computed(defaultStore.makeGetterSetter('defaultNoteLocalOnly'));
const rememberNoteVisibility = computed(defaultStore.makeGetterSetter('rememberNoteVisibility')); const rememberNoteVisibility = computed(defaultStore.makeGetterSetter('rememberNoteVisibility'));
const keepCw = computed(defaultStore.makeGetterSetter('keepCw')); const keepCw = computed(defaultStore.makeGetterSetter('keepCw'));
const hideSensitiveInformation = computed(defaultStore.makeGetterSetter('hideSensitiveInformation'));
const hideDirectMessages = computed(defaultStore.makeGetterSetter('hideDirectMessages')); const hideDirectMessages = computed(defaultStore.makeGetterSetter('hideDirectMessages'));
function save() { function save() {

View file

@ -5,6 +5,7 @@
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { defaultStore } from "@/store.js";
/** /**
* 稿 * 稿
@ -23,6 +24,10 @@ export const getNoteSummary = (note?: Misskey.entities.Note | null): string => {
return `(${i18n.ts.invisibleNote})`; return `(${i18n.ts.invisibleNote})`;
} }
if (note.visibility === 'specified' && defaultStore.state.hideDirectMessages) {
return `(${i18n.ts.youAreHidingSensitiveInformation})`;
}
let summary = ''; let summary = '';
// 本文 // 本文