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

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