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) {
return checkWordMute(note) || checkWordMute(reply) || checkWordMute(renote)
return checkWordMute(note) || checkWordMute(reply) || checkWordMute(renote);
}
return false;

View File

@ -262,18 +262,14 @@ const inChannel = inject("inChannel", null);
let note = $ref(deepClone(props.note));
const softMuteReasonI18nSrc = (what?: string) => {
if (what === "note")
return i18n.ts.userSaysSomethingReason;
if (what === "reply")
return i18n.ts.userSaysSomethingReasonReply;
if (what === "renote")
return i18n.ts.userSaysSomethingReasonRenote;
if (what === "quote")
return i18n.ts.userSaysSomethingReasonQuote;
if (what === "note") return i18n.ts.userSaysSomethingReason;
if (what === "reply") return i18n.ts.userSaysSomethingReasonReply;
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
return i18n.ts.userSaysSomething;
}
};
// plugin
if (noteViewInterruptors.length > 0) {
@ -305,7 +301,9 @@ let appearNote = $computed(() =>
const isMyRenote = $i && $i.id === note.userId;
const showContent = 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 translating = ref(false);
const enableEmojiReactions = defaultStore.state.enableEmojiReactions;

View File

@ -111,18 +111,14 @@ const inChannel = inject("inChannel", null);
let note = $ref(deepClone(props.note));
const softMuteReasonI18nSrc = (what?: string) => {
if (what === "note")
return i18n.ts.userSaysSomethingReason;
if (what === "reply")
return i18n.ts.userSaysSomethingReasonReply;
if (what === "renote")
return i18n.ts.userSaysSomethingReasonRenote;
if (what === "quote")
return i18n.ts.userSaysSomethingReasonQuote;
if (what === "note") return i18n.ts.userSaysSomethingReason;
if (what === "reply") return i18n.ts.userSaysSomethingReasonReply;
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
return i18n.ts.userSaysSomething;
}
};
const enableEmojiReactions = defaultStore.state.enableEmojiReactions;
@ -156,7 +152,9 @@ let appearNote = $computed(() =>
const isMyRenote = $i && $i.id === note.userId;
const showContent = 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 translating = ref(false);
const urls = appearNote.text

View File

@ -226,18 +226,14 @@ const props = withDefaults(
let note = $ref(deepClone(props.note));
const softMuteReasonI18nSrc = (what?: string) => {
if (what === "note")
return i18n.ts.userSaysSomethingReason;
if (what === "reply")
return i18n.ts.userSaysSomethingReasonReply;
if (what === "renote")
return i18n.ts.userSaysSomethingReasonRenote;
if (what === "quote")
return i18n.ts.userSaysSomethingReasonQuote;
if (what === "note") return i18n.ts.userSaysSomethingReason;
if (what === "reply") return i18n.ts.userSaysSomethingReasonReply;
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
return i18n.ts.userSaysSomething;
}
};
const isRenote =
note.renote != null &&
@ -255,7 +251,9 @@ let appearNote = $computed(() =>
isRenote ? (note.renote as misskey.entities.Note) : note
);
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 translating = ref(false);
const replies: misskey.entities.Note[] =

View File

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

View File

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