]> git.smokeofanarchy.ru Git - space-station-14.git/commit
SS14-17313 Chatfactor: Chat Censorship Systems (#25908)
authorHannah Giovanna Dawson <karakkaraz@gmail.com>
Mon, 25 Mar 2024 23:50:20 +0000 (23:50 +0000)
committerGitHub <noreply@github.com>
Mon, 25 Mar 2024 23:50:20 +0000 (10:50 +1100)
commitbf98a6a8bb2a57fb149459d6b053eaaf6abc8cd7
tree414bc699a3951f0e7dd7a9a495200abcd7c3ac5a
parentbd58954d4e1612e7aeff7b80ff27eeeed1c474f8
SS14-17313 Chatfactor: Chat Censorship Systems (#25908)

* SS14-17313 Chat Censorship Systems

Adds some systems to manage chat censorship:

1. No-op: does nothing
2. SimpleCensor: a regex-free censor with a variety of rules to use
3. RegexCensor: a censor that uses regex.

This exposes a singleton backed by a builder pattern (ChatCensor) that
is set up, probably during the code init phase, and then globally available
for your censorship needs.

* Migrate to Shared

* Add a reset function to the builder.

* Resolve PJB's feedback; add unit tests
Content.Shared/Chat/V2/Moderation/ChatCensor.cs [new file with mode: 0644]
Content.Shared/Chat/V2/Moderation/RegexCensor.cs [new file with mode: 0644]
Content.Shared/Chat/V2/Moderation/SimpleCensor.cs [new file with mode: 0644]
Content.Tests/Shared/Chat/V2/Moderation/SimpleCensor.cs [new file with mode: 0644]