mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-22 08:53:48 +01:00
Check alt text on mutes
This commit is contained in:
parent
2379051e83
commit
490ede7caa
@ -5,6 +5,7 @@ import type { User } from "@/models/entities/user.js";
|
||||
type NoteLike = {
|
||||
userId: Note["userId"];
|
||||
text: Note["text"];
|
||||
files: Note["files"];
|
||||
cw?: Note["cw"];
|
||||
};
|
||||
|
||||
@ -18,7 +19,7 @@ function checkWordMute(
|
||||
): boolean {
|
||||
if (note == null) return false;
|
||||
|
||||
const text = ((note.cw ?? "") + " " + (note.text ?? "")).trim();
|
||||
const text = `${note.cw ?? ""} ${note.text ?? ""} ${note.files.map((f) => f.comment ?? "").join(" ")}`.trim();
|
||||
if (text === "") return false;
|
||||
|
||||
for (const mutePattern of mutedWords) {
|
||||
|
@ -10,7 +10,7 @@ function checkWordMute(
|
||||
note: NoteLike,
|
||||
mutedWords: Array<string | string[]>,
|
||||
): Muted {
|
||||
const text = ((note.cw ?? "") + " " + (note.text ?? "")).trim();
|
||||
const text = `${note.cw ?? ""} ${note.text ?? ""} ${note.files.map((f) => f.comment ?? "").join(" ")}`.trim();
|
||||
if (text === "") return NotMuted;
|
||||
|
||||
let result = { muted: false, matched: [] };
|
||||
|
Loading…
Reference in New Issue
Block a user