mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-25 11:27:31 -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 ?? ""}`;
|
||||
if (note.files != null)
|
||||
text += ` ${note.files.map((f) => f.comment ?? "").join(" ")}`;
|
||||
text = text.trim();
|
||||
text = text.trim().toLowerCase();
|
||||
|
||||
if (text === "") return false;
|
||||
|
||||
|
@ -33,7 +33,7 @@ function checkWordMute(
|
|||
|
||||
if (
|
||||
keywords.length > 0 &&
|
||||
keywords.every((keyword) => text.includes(keyword))
|
||||
keywords.every((keyword) => text.includes(keyword.toLowerCase()))
|
||||
)
|
||||
return true;
|
||||
} else {
|
||||
|
|
|
@ -13,7 +13,7 @@ function checkWordMute(
|
|||
let text = `${note.cw ?? ""} ${note.text ?? ""}`;
|
||||
if (note.files != null)
|
||||
text += ` ${note.files.map((f) => f.comment ?? "").join(" ")}`;
|
||||
text = text.trim();
|
||||
text = text.trim().toLowerCase();
|
||||
|
||||
if (text === "") return NotMuted;
|
||||
|
||||
|
@ -26,7 +26,7 @@ function checkWordMute(
|
|||
|
||||
if (
|
||||
keywords.length > 0 &&
|
||||
keywords.every((keyword) => text.includes(keyword))
|
||||
keywords.every((keyword) => text.includes(keyword.toLowerCase()))
|
||||
) {
|
||||
result.muted = true;
|
||||
result.matched.push(...keywords);
|
||||
|
|
Loading…
Reference in a new issue