mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-29 05:17:39 -07:00
Make non-regex word mutes case insensitive
This commit is contained in:
parent
e1481fc8ee
commit
5701946511
2 changed files with 4 additions and 4 deletions
|
@ -22,7 +22,7 @@ function checkWordMute(
|
||||||
let text = `${note.cw ?? ""} ${note.text ?? ""}`;
|
let text = `${note.cw ?? ""} ${note.text ?? ""}`;
|
||||||
if (note.files != null)
|
if (note.files != null)
|
||||||
text += ` ${note.files.map((f) => f.comment ?? "").join(" ")}`;
|
text += ` ${note.files.map((f) => f.comment ?? "").join(" ")}`;
|
||||||
text = text.trim();
|
text = text.trim().toLowerCase();
|
||||||
|
|
||||||
if (text === "") return false;
|
if (text === "") return false;
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ function checkWordMute(
|
||||||
|
|
||||||
if (
|
if (
|
||||||
keywords.length > 0 &&
|
keywords.length > 0 &&
|
||||||
keywords.every((keyword) => text.includes(keyword))
|
keywords.every((keyword) => text.includes(keyword.toLowerCase()))
|
||||||
)
|
)
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -13,7 +13,7 @@ function checkWordMute(
|
||||||
let text = `${note.cw ?? ""} ${note.text ?? ""}`;
|
let text = `${note.cw ?? ""} ${note.text ?? ""}`;
|
||||||
if (note.files != null)
|
if (note.files != null)
|
||||||
text += ` ${note.files.map((f) => f.comment ?? "").join(" ")}`;
|
text += ` ${note.files.map((f) => f.comment ?? "").join(" ")}`;
|
||||||
text = text.trim();
|
text = text.trim().toLowerCase();
|
||||||
|
|
||||||
if (text === "") return NotMuted;
|
if (text === "") return NotMuted;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ function checkWordMute(
|
||||||
|
|
||||||
if (
|
if (
|
||||||
keywords.length > 0 &&
|
keywords.length > 0 &&
|
||||||
keywords.every((keyword) => text.includes(keyword))
|
keywords.every((keyword) => text.includes(keyword.toLowerCase()))
|
||||||
) {
|
) {
|
||||||
result.muted = true;
|
result.muted = true;
|
||||||
result.matched.push(...keywords);
|
result.matched.push(...keywords);
|
||||||
|
|
Loading…
Reference in a new issue