Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profanity filter changes #665

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

11EJDE11
Copy link
Contributor

@11EJDE11 11EJDE11 commented Feb 13, 2025

  • Adds a new profanity filter.
  • Adds a setting to CnCNet options panel to enable/disable word censoring (on by default - may need changing?).
  • Censors words in channel names (the original, uncensored name remains accessible in code).
  • Censors words in chat messages (the original, uncensored message remains accessible in code).
  • Updates CnCNetOptionPanel to use constants for positioning.

The new profanity filter will filter l33tspeak variations of words, repeating characters, and basic bypass attempts. For example, these are all considered profane:

  • Shit
  • Sh!t
  • Ss5shhhhii11tttt
  • S_H_I-T
  • 5_h_1_t

It's a regex based filter system. Hoping the comments make it easy to follow. On my somewhat dated laptop it can censor 10,000 medium sized strings in 200ms, and checking if a string is offensive will be quicker than that.

Censoring usernames isn't included in this PR. That's a different beast and will need more time.
The word "Admin" is now only considered profane when choosing your username.

Copy link

Nightly build for this pull request:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant