feat: chat filters cover bios

The server refuses a bio that breaks its filter and hides one saved before.
The client filter now runs on your own card too.
This commit is contained in:
Burrowdev committed 2026-10-17 14:35:29 +03:00
1 parent 89fe4d2a28
commit 80383e8dec
7 files changed
+22 -9

No files matched your search

+5 -2
View File
@@ -966,14 +966,17 @@ const playedText = seconds => {
return `Played ${minutes} minute${minutes === 1 ? "" : "s"}`;
};
const cardBio = account => {
// a bio from before the chat filter, or one a newer rule catches, is not
// shown (lib/chat-filter.txt).
const bio = account.bio && !chatFilter.broken(account.bio) ? account.bio : "";
if (!account.playtimePublic) {
return account.bio;
return bio;
}
const session = online.get(account.username.toLowerCase());
if (session) {
countPlaytime(session);
}
return account.bio ? `${playedText(account.playtime)}\n\n${account.bio}` : playedText(account.playtime);
return bio ? `${playedText(account.playtime)}\n\n${bio}` : playedText(account.playtime);
};
// the time since it was last counted, added to the account's playtime.