mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-16 20:20:29 +03:00
Better invites management (#2336)
* move block users to account settings * filter invites and add more options * add better rate limit recovery in rateLimitedActions util function
This commit is contained in:
parent
0d27bde33e
commit
206ed33516
17 changed files with 1088 additions and 524 deletions
15
src/app/plugins/bad-words.ts
Normal file
15
src/app/plugins/bad-words.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import * as badWords from 'badwords-list';
|
||||
import { sanitizeForRegex } from '../utils/regex';
|
||||
|
||||
const additionalBadWords: string[] = ['Torture', 'T0rture'];
|
||||
|
||||
const fullBadWordList = additionalBadWords.concat(
|
||||
badWords.array.filter((word) => !additionalBadWords.includes(word))
|
||||
);
|
||||
|
||||
export const BAD_WORDS_REGEX = new RegExp(
|
||||
`(\\b|_)(${fullBadWordList.map((word) => sanitizeForRegex(word)).join('|')})(\\b|_)`,
|
||||
'g'
|
||||
);
|
||||
|
||||
export const testBadWords = (str: string): boolean => !!str.toLowerCase().match(BAD_WORDS_REGEX);
|
||||
Loading…
Add table
Add a link
Reference in a new issue