This commit is contained in:
naskya 2023-05-04 14:41:18 +09:00
parent 137cef81b6
commit ebfd07628e
No known key found for this signature in database
GPG key ID: 164DFF24E2D40139
6 changed files with 29 additions and 35 deletions

View file

@ -67,7 +67,7 @@ export async function getWordHardMute(
} }
if (mutedWords.length > 0) { if (mutedWords.length > 0) {
return checkWordMute(note) || checkWordMute(reply) || checkWordMute(renote) return checkWordMute(note) || checkWordMute(reply) || checkWordMute(renote);
} }
return false; return false;

View file

@ -262,18 +262,14 @@ const inChannel = inject("inChannel", null);
let note = $ref(deepClone(props.note)); let note = $ref(deepClone(props.note));
const softMuteReasonI18nSrc = (what?: string) => { const softMuteReasonI18nSrc = (what?: string) => {
if (what === "note") if (what === "note") return i18n.ts.userSaysSomethingReason;
return i18n.ts.userSaysSomethingReason; if (what === "reply") return i18n.ts.userSaysSomethingReasonReply;
if (what === "reply") if (what === "renote") return i18n.ts.userSaysSomethingReasonRenote;
return i18n.ts.userSaysSomethingReasonReply; if (what === "quote") return i18n.ts.userSaysSomethingReasonQuote;
if (what === "renote")
return i18n.ts.userSaysSomethingReasonRenote;
if (what === "quote")
return i18n.ts.userSaysSomethingReasonQuote;
// I don't think here is reachable, but just in case // I don't think here is reachable, but just in case
return i18n.ts.userSaysSomething; return i18n.ts.userSaysSomething;
} };
// plugin // plugin
if (noteViewInterruptors.length > 0) { if (noteViewInterruptors.length > 0) {
@ -305,7 +301,9 @@ let appearNote = $computed(() =>
const isMyRenote = $i && $i.id === note.userId; const isMyRenote = $i && $i.id === note.userId;
const showContent = ref(false); const showContent = ref(false);
const isDeleted = ref(false); const isDeleted = ref(false);
const muted = ref(getWordSoftMute(appearNote, $i, defaultStore.state.mutedWords)); const muted = ref(
getWordSoftMute(appearNote, $i, defaultStore.state.mutedWords)
);
const translation = ref(null); const translation = ref(null);
const translating = ref(false); const translating = ref(false);
const enableEmojiReactions = defaultStore.state.enableEmojiReactions; const enableEmojiReactions = defaultStore.state.enableEmojiReactions;

View file

@ -111,18 +111,14 @@ const inChannel = inject("inChannel", null);
let note = $ref(deepClone(props.note)); let note = $ref(deepClone(props.note));
const softMuteReasonI18nSrc = (what?: string) => { const softMuteReasonI18nSrc = (what?: string) => {
if (what === "note") if (what === "note") return i18n.ts.userSaysSomethingReason;
return i18n.ts.userSaysSomethingReason; if (what === "reply") return i18n.ts.userSaysSomethingReasonReply;
if (what === "reply") if (what === "renote") return i18n.ts.userSaysSomethingReasonRenote;
return i18n.ts.userSaysSomethingReasonReply; if (what === "quote") return i18n.ts.userSaysSomethingReasonQuote;
if (what === "renote")
return i18n.ts.userSaysSomethingReasonRenote;
if (what === "quote")
return i18n.ts.userSaysSomethingReasonQuote;
// I don't think here is reachable, but just in case // I don't think here is reachable, but just in case
return i18n.ts.userSaysSomething; return i18n.ts.userSaysSomething;
} };
const enableEmojiReactions = defaultStore.state.enableEmojiReactions; const enableEmojiReactions = defaultStore.state.enableEmojiReactions;
@ -156,7 +152,9 @@ let appearNote = $computed(() =>
const isMyRenote = $i && $i.id === note.userId; const isMyRenote = $i && $i.id === note.userId;
const showContent = ref(false); const showContent = ref(false);
const isDeleted = ref(false); const isDeleted = ref(false);
const muted = ref(getWordSoftMute(appearNote, $i, defaultStore.state.mutedWords)); const muted = ref(
getWordSoftMute(appearNote, $i, defaultStore.state.mutedWords)
);
const translation = ref(null); const translation = ref(null);
const translating = ref(false); const translating = ref(false);
const urls = appearNote.text const urls = appearNote.text

View file

@ -226,18 +226,14 @@ const props = withDefaults(
let note = $ref(deepClone(props.note)); let note = $ref(deepClone(props.note));
const softMuteReasonI18nSrc = (what?: string) => { const softMuteReasonI18nSrc = (what?: string) => {
if (what === "note") if (what === "note") return i18n.ts.userSaysSomethingReason;
return i18n.ts.userSaysSomethingReason; if (what === "reply") return i18n.ts.userSaysSomethingReasonReply;
if (what === "reply") if (what === "renote") return i18n.ts.userSaysSomethingReasonRenote;
return i18n.ts.userSaysSomethingReasonReply; if (what === "quote") return i18n.ts.userSaysSomethingReasonQuote;
if (what === "renote")
return i18n.ts.userSaysSomethingReasonRenote;
if (what === "quote")
return i18n.ts.userSaysSomethingReasonQuote;
// I don't think here is reachable, but just in case // I don't think here is reachable, but just in case
return i18n.ts.userSaysSomething; return i18n.ts.userSaysSomething;
} };
const isRenote = const isRenote =
note.renote != null && note.renote != null &&
@ -255,7 +251,9 @@ let appearNote = $computed(() =>
isRenote ? (note.renote as misskey.entities.Note) : note isRenote ? (note.renote as misskey.entities.Note) : note
); );
const isDeleted = ref(false); const isDeleted = ref(false);
const muted = ref(getWordSoftMute(appearNote, $i, defaultStore.state.mutedWords)); const muted = ref(
getWordSoftMute(appearNote, $i, defaultStore.state.mutedWords)
);
const translation = ref(null); const translation = ref(null);
const translating = ref(false); const translating = ref(false);
const replies: misskey.entities.Note[] = const replies: misskey.entities.Note[] =

View file

@ -1,6 +1,6 @@
<template> <template>
<span v-if="note.visibility !== 'public'" :class="$style.visibility"> <span v-if="note.visibility !== 'public'" :class="$style.visibility">
<i <i
v-if="note.visibility === 'home'" v-if="note.visibility === 'home'"
class="ph-house ph-bold ph-lg" class="ph-house ph-bold ph-lg"
v-tooltip="i18n.ts._visibility.home" v-tooltip="i18n.ts._visibility.home"
@ -17,7 +17,7 @@
></i> ></i>
</span> </span>
<span v-if="note.localOnly" :class="$style.localOnly" <span v-if="note.localOnly" :class="$style.localOnly"
><i ><i
class="ph-hand-fist ph-bold ph-lg" class="ph-hand-fist ph-bold ph-lg"
v-tooltip="i18n.ts._visibility.localOnly" v-tooltip="i18n.ts._visibility.localOnly"
></i ></i

View file

@ -1,7 +1,7 @@
export type Muted = { export type Muted = {
muted: boolean; muted: boolean;
matched: string[]; matched: string[];
what?: string; // "note" || "reply" || "renote" || "quote" what?: string; // "note" || "reply" || "renote" || "quote"
}; };
const NotMuted = { muted: false, matched: [] }; const NotMuted = { muted: false, matched: [] };
@ -74,7 +74,7 @@ export function getWordSoftMute(
if (note.renote) { if (note.renote) {
let renoteMuted = checkWordMute(note.renote); let renoteMuted = checkWordMute(note.renote);
if (renoteMuted.muted) { if (renoteMuted.muted) {
renoteMuted.what = (note.text == null ? "renote" : "quote"); renoteMuted.what = note.text == null ? "renote" : "quote";
return renoteMuted; return renoteMuted;
} }
} }