Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: センシティブチャンネルの投稿がセンシティブなファイルを含む投稿扱いされる #154

Merged
merged 4 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
-

### Client
-
- Fix: センシティブチャンネルの投稿がセンシティブなファイルを含む投稿扱いされる問題を修正

### Server
- Fix: 禁止ワード設定によってリモートの投稿がブロックされると、InboxキューにDelayed Jobとして残ってしまう問題を修正
Expand Down
4 changes: 4 additions & 0 deletions locales/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4896,6 +4896,10 @@ export interface Locale extends ILocale {
* {name}のセンシティブなファイルを含む投稿
*/
"userSaysSomethingSensitive": ParameterizedString<"name">;
/**
* {name}のセンシティブチャンネルの投稿
*/
"userSaysSomethingInSensitiveChannel": ParameterizedString<"name">;
/**
* スワイプしてタブを切り替える
*/
Expand Down
1 change: 1 addition & 0 deletions locales/ja-JP.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,7 @@ backToTitle: "タイトルへ"
hemisphere: "お住まいの地域"
withSensitive: "センシティブなファイルを含むノートを表示"
userSaysSomethingSensitive: "{name}のセンシティブなファイルを含む投稿"
userSaysSomethingInSensitiveChannel: "{name}のセンシティブチャンネルでの投稿"
enableHorizontalSwipe: "スワイプしてタブを切り替える"

_bubbleGame:
Expand Down
13 changes: 10 additions & 3 deletions packages/frontend/src/components/MkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ SPDX-License-Identifier: AGPL-3.0-only
</MkA>
</template>
</I18n>
<I18n v-if="muted === 'sensitiveChannel'" :src="i18n.ts.userSaysSomethingInSensitiveChannel" tag="small">
<template #name>
<MkA v-user-preview="appearNote.userId" :to="userPage(appearNote.user)">
<MkUserName :user="appearNote.user"/>
</MkA>
</template>
</I18n>
<I18n v-else :src="i18n.ts.userSaysSomething" tag="small">
<template #name>
<MkA v-user-preview="appearNote.userId" :to="userPage(appearNote.user)">
Expand Down Expand Up @@ -273,9 +280,9 @@ const renoteCollapsed = ref(

/* Overload FunctionにLintが対応していないのでコメントアウト
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly: true): boolean;
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly: false): boolean | 'sensitiveMute';
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly: false): boolean | 'sensitiveMute' | 'sensitiveChannel';
*/
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly = false): boolean | 'sensitiveMute' {
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly = false): boolean | 'sensitiveMute' | 'sensitiveChannel' {
if (mutedWords == null) return false;

if (checkWordMute(noteToCheck, $i, mutedWords)) return true;
Expand All @@ -284,8 +291,8 @@ function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string

if (checkOnly) return false;

if (collapseSensitiveChannel && noteToCheck.channel?.isSensitive) return 'sensitiveChannel';
if (inTimeline && !defaultStore.state.tl.filter.withSensitive && noteToCheck.files?.some((v) => v.isSensitive)) return 'sensitiveMute';
if (collapseSensitiveChannel && noteToCheck.channel?.isSensitive) return 'sensitiveMute';
return false;
}

Expand Down
Loading