openvibers/openvibe.live Commits

Home hero: a test account is never the audience (#670)

OP OpenVibers committed 6 days ago · c63b0f56b3 · 2 files, +11 −4

Changes

ddiff --git a/server/ai/hero-copy.js b/server/ai/hero-copy.js
iindex 58b7c3e9..c068f5b5 100644
---- a/server/ai/hero-copy.js
++++ b/server/ai/hero-copy.js
@@@ -19,12 +19,16 @@ const MINOR_SKIN = { test: (s) => MINOR.test(s) && SKIN.test(s) };
const CRUDE = /\b(cum|horny|porn\w*|nsfw|fuck\w*|shit\w*|piss\w*|bitch\w*|cunt|wank\w*|poop\w*|fart\w*|turds?|ass(hole)?s?|butthole)\b/i;
// A keyboard mash taken for a name ("qeqweqwe watchers").
const MASH = /(qwe|ewq|asdf|sdfg|zxcv|qeqw)/i;
++// A test account taken for an audience ("Live streaming for testing_testers crew testing", 2026-11-07): a name that
++// starts or ends a snake_case part with "test", or "test"/"tester"/"testing" followed by digits. "contest_king",
++// "Tesla" and the word "testing" on its own are not test accounts.
++const TEST_ACCOUNT = /\btest\w*_\w+|\b\w+_test\w*|\btest(er|ing)?\d+\b/i;
--const RULES = [NO_FREE, MINOR_SKIN, CRUDE, MASH];
++const RULES = [NO_FREE, MINOR_SKIN, CRUDE, MASH, TEST_ACCOUNT];
function publicOk(text) {
const s = String(text == null ? '' : text);
return !RULES.some((re) => re.test(s));
}
--module.exports = { publicOk, NO_FREE, MINOR_SKIN, CRUDE, MASH };
++module.exports = { publicOk, NO_FREE, MINOR_SKIN, CRUDE, MASH, TEST_ACCOUNT };
ddiff --git a/test/hero-copy.test.js b/test/hero-copy.test.js
iindex 228216fd..7423d7c0 100644
---- a/test/hero-copy.test.js
++++ b/test/hero-copy.test.js
@@@ -12,9 +12,12 @@ const assert = require('assert');
const { publicOk } = require('../server/ai/hero-copy');
const refused = ['qeqweqwe watchers', 'free streaming fans', 'shitpost central', 'asdfgh chill crew', 'horny chat crew',
-- 'shirtless kids crew', 'naked kids crew', 'nude teen fans'];
++ 'shirtless kids crew', 'naked kids crew', 'nude teen fans',
++ // Test accounts (2026-11-07: "Live streaming for testing_testers crew testing" was the home's first line).
++ 'testing_testers crew testing', 'test_user fans', 'alex_test hype squad', 'tester2 chat crew'];
for (const s of refused) assert.strictEqual(publicOk(s), false, `refused: ${s}`);
const kept = ['2fat’s hype squad', 'JustTwoCuteBesties fans', 'Maticus and crew', 'JessePlays rhythm lovers', 'meme spike mob', 'van-dwelling coders',
-- 'multi-GPU benchmark junkies', 'goosely’s loyal 3 viewers', 'class clowns', 'ara007 shirtless thoughts', 'figure-drawing nude art fans', 'button mashers', 'from Tesla GPUs to spicy memes', 'throttle the hype, not the vibes', 'Goosely chaos chat'];
++ 'multi-GPU benchmark junkies', 'goosely’s loyal 3 viewers', 'class clowns', 'ara007 shirtless thoughts', 'figure-drawing nude art fans', 'button mashers', 'from Tesla GPUs to spicy memes', 'throttle the hype, not the vibes', 'Goosely chaos chat',
++ 'contest_king fans', 'speed-testing crew', 'testing new overlays together'];
for (const s of kept) assert.strictEqual(publicOk(s), true, `kept: ${s}`);
console.log('hero copy: all checks passed');