openvibers/openvibe.live Commits

The home's quote strip judges with openvibe-sdk/front-page, the platform's one rule (moved there from here) (#356)

OP OpenVibers committed 19 days ago · 59d13d5fa1 · 2 files, +8 −20

Changes

ddiff --git a/server/home/front-page-text.js b/server/home/front-page-text.js
iindex d6ed7e07..c38be1dc 100644
---- a/server/home/front-page-text.js
++++ b/server/home/front-page-text.js
@@@ -1,23 +1,10 @@
'use strict';
/**
* What streamers said, as the home page's "Lately on OpenVibe" strip quotes it: the front page of the site, read by
-- * everyone who arrives. A quote with a slur (chat's built-in categories), strong profanity or a hate topic out of
-- * context ("…that's got an anti-semitic trope", "…people that I want to fucking follow anymore", the strip on
-- * 2026-10-24) is left off it; the next best take is shown instead. The Rundown keeps every take as said.
++ * everyone who arrives. A quote with a slur, strong profanity (English, Portuguese, Spanish, French, German) or a hate
++ * topic out of context is left off it; the next best take is shown instead. The Rundown keeps every take as said.
++ *
++ * The rule is the platform's own since openvibe-sdk 0.64.0 (openvibe-sdk/front-page, moved from here: Live#345/#346),
++ * so Community's "Most viewed" and every other front page judge the same way.
*/
--const { CORE_SLUR_CATEGORIES } = require('../chat/moderation-utils');
--
--const ROUGH = /\b(?:f+u+c+k\w*|motherf\w*|sh[i1]t(?:s|ty|ting|ted)?|bullshit|cunts?|bitch\w*|whores?|sluts?|pussy|retard\w*|nazis?|hitler|holocaust|anti-?semit\w*|kkk|rap(?:e|ed|es|ist|ists|ing))\b/i;
--// Streamers here speak Portuguese, Spanish, French and German too ("…tô com o rollback do caralho" led the strip on
--// 2026-10-24 once the English words were out). Letter boundaries, not \b: \b does not know ç, ñ or ß.
--const ROUGH_INTL = /(?<!\p{L})(?:caralho|porra|foda(?:-se)?|fodase|merda|putas?|viado|buceta|mierda|joder|coño|pendejos?|cabr[oó]n(?:es)?|verga|chinga\p{L}*|putain|merde|connard|salope|scheiße|scheisse|hurensohn|ficken|fick)(?!\p{L})/iu;
--const SLUR_RES = CORE_SLUR_CATEGORIES.map((c) => ({ c, res: c.patterns.map((p) => new RegExp(p, 'i')) }));
--
--/** True when the text may lead the front page. */
--function frontPageOk(text) {
-- const t = String(text || '');
-- if (!t.trim() || ROUGH.test(t) || ROUGH_INTL.test(t)) return false;
-- return !SLUR_RES.some(({ c, res }) => c.generateCandidates(t).some((x) => res.some((re) => re.test(x))));
--}
--
--module.exports = { frontPageOk };
++module.exports = { frontPageOk: require('openvibe-sdk/front-page').frontPageOk };
ddiff --git a/test/home-front-page-text.test.js b/test/home-front-page-text.test.js
iindex 322f3f88..95822f81 100644
---- a/test/home-front-page-text.test.js
++++ b/test/home-front-page-text.test.js
@@@ -1,7 +1,8 @@
'use strict';
/**
* The home page's "Lately on OpenVibe" quotes leave out a take with a slur, strong profanity or a hate topic, and show
-- * the next best one (server/home/front-page-text.js); the Rundown keeps every take as said.
++ * the next best one (server/home/front-page-text.js, the platform rule from openvibe-sdk/front-page); the Rundown keeps every
++ * take as said.
*
* node test/home-front-page-text.test.js
*/