Fix Emote Chat Sanitizer (#32940)

* Fix bug?

* Fix :)

* aaaa

* AAAA!!!

* comment

* Nicer code

* What's a pull requestWhat's a pull request?
This commit is contained in:
Thomas
2024-10-24 00:10:13 -05:00
committed by GitHub
parent 79c35e0a41
commit d4da9923ea
3 changed files with 34 additions and 4 deletions

View File

@@ -746,8 +746,9 @@ public sealed partial class ChatSystem : SharedChatSystem
// ReSharper disable once InconsistentNaming
private string SanitizeInGameICMessage(EntityUid source, string message, out string? emoteStr, bool capitalize = true, bool punctuate = false, bool capitalizeTheWordI = true)
{
var newMessage = message.Trim();
newMessage = SanitizeMessageReplaceWords(newMessage);
var newMessage = SanitizeMessageReplaceWords(message.Trim());
GetRadioKeycodePrefix(source, newMessage, out newMessage, out var prefix);
// Sanitize it first as it might change the word order
_sanitizer.TrySanitizeEmoteShorthands(newMessage, source, out newMessage, out emoteStr);
@@ -759,7 +760,7 @@ public sealed partial class ChatSystem : SharedChatSystem
if (punctuate)
newMessage = SanitizeMessagePeriod(newMessage);
return newMessage;
return prefix + newMessage;
}
private string SanitizeInGameOOCMessage(string message)