]> git.smokeofanarchy.ru Git - space-station-14.git/commit
Sanitize shorthand emotes throughought the whole message (#28645)
authorThomas <87614336+Aeshus@users.noreply.github.com>
Thu, 17 Oct 2024 14:01:32 +0000 (09:01 -0500)
committerGitHub <noreply@github.com>
Thu, 17 Oct 2024 14:01:32 +0000 (16:01 +0200)
commit876c44cd660f729aa9c7b0ab3b1d4cad586afd20
treef82a6cc3f426ad256df85092df4f4f26ec5b6df3
parentea96e8a1cfd1c5f42e449bdd979713c9b839b0c3
Sanitize shorthand emotes throughought the whole message (#28645)

* Rename ChatSanitizationManager to ChatEmoteSanitizationManager

The prior name was kind of confusing as there's a emote one and
then now there's also chat expansion happening in the accent system,
so knowing which I actually need to edit is useful.

So, I just need to keep myself not confused.

* Rename smileyToEmote and remove punctuation duplicates

The name SmileyToEmote is just... Bad.

Plus, I needed to remove the punctuation duplicates as that would
break any kind of regex parsing that I tried.

* Switch to regex from checking end of string

I also changed from System.Globalization to ILocalizationManager.

Writing that regex was definitely an experience.

* Document regex and the manager

* Rename it back

* Simplify regex
Content.Server/Chat/Managers/ChatSanitizationManager.cs
Content.Server/Chat/Managers/IChatSanitizationManager.cs
Content.Server/Chat/Systems/ChatSystem.cs