From 1cb7d8b5245fcda682d2d782e9caf48327157581 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Sat, 19 Oct 2024 23:24:50 -0400 Subject: [PATCH 1/2] add periods to chatsan entries ending with letters --- .../Chat/Managers/ChatSanitizationManager.cs | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Content.Server/Chat/Managers/ChatSanitizationManager.cs b/Content.Server/Chat/Managers/ChatSanitizationManager.cs index 634d8cdefab..f6c83ba6f8e 100644 --- a/Content.Server/Chat/Managers/ChatSanitizationManager.cs +++ b/Content.Server/Chat/Managers/ChatSanitizationManager.cs @@ -30,14 +30,14 @@ public sealed class ChatSanitizationManager : IChatSanitizationManager { ")=", "chatsan-frowns" }, { "]:", "chatsan-frowns" }, { "]=", "chatsan-frowns" }, - { ":D", "chatsan-smiles-widely" }, + { ":D.", "chatsan-smiles-widely" }, // Frontier: add period { "D:", "chatsan-frowns-deeply" }, - { ":O", "chatsan-surprised" }, + { ":O.", "chatsan-surprised" }, // Frontier: add period { ":3", "chatsan-smiles" }, //nope - { ":S", "chatsan-uncertain" }, + { ":S.", "chatsan-uncertain" }, // Frontier: add period { ":>", "chatsan-grins" }, { ":<", "chatsan-pouts" }, - { "xD", "chatsan-laughs" }, + { "xD.", "chatsan-laughs" }, // Frontier: add period { ":'(", "chatsan-cries" }, { ":'[", "chatsan-cries" }, { "='(", "chatsan-cries" }, @@ -48,35 +48,35 @@ public sealed class ChatSanitizationManager : IChatSanitizationManager { "]'=", "chatsan-cries" }, { ";-;", "chatsan-cries" }, { ";_;", "chatsan-cries" }, - { "qwq", "chatsan-cries" }, - { ":u", "chatsan-smiles-smugly" }, - { ":v", "chatsan-smiles-smugly" }, - { ">:i", "chatsan-annoyed" }, - { ":i", "chatsan-sighs" }, + { "qwq.", "chatsan-cries" }, // Frontier: add period + { ":u.", "chatsan-smiles-smugly" }, // Frontier: add period + { ":v.", "chatsan-smiles-smugly" }, // Frontier: add period + { ">:i.", "chatsan-annoyed" }, // Frontier: add period + { ":i.", "chatsan-sighs" }, // Frontier: add period { ":|", "chatsan-sighs" }, - { ":p", "chatsan-stick-out-tongue" }, - { ";p", "chatsan-stick-out-tongue" }, - { ":b", "chatsan-stick-out-tongue" }, + { ":p.", "chatsan-stick-out-tongue" }, // Frontier: add period + { ";p.", "chatsan-stick-out-tongue" }, // Frontier: add period + { ":b.", "chatsan-stick-out-tongue" }, // Frontier: add period { "0-0", "chatsan-wide-eyed" }, - { "o-o", "chatsan-wide-eyed" }, - { "o.o", "chatsan-wide-eyed" }, + { "o-o.", "chatsan-wide-eyed" }, // Frontier: add period + { "o.o.", "chatsan-wide-eyed" }, // Frontier: add period { "._.", "chatsan-surprised" }, { ".-.", "chatsan-confused" }, { "-_-", "chatsan-unimpressed" }, - { "smh", "chatsan-unimpressed" }, + { "smh.", "chatsan-unimpressed" }, // Frontier: add period { "o/", "chatsan-waves" }, { "^^/", "chatsan-waves" }, { ":/", "chatsan-uncertain" }, { ":\\", "chatsan-uncertain" }, - { "lmao", "chatsan-laughs" }, - { "lmfao", "chatsan-laughs" }, - { "lol", "chatsan-laughs" }, - { "lel", "chatsan-laughs" }, - { "kek", "chatsan-laughs" }, - { "rofl", "chatsan-laughs" }, + { "lmao.", "chatsan-laughs" }, // Frontier: add period + { "lmfao.", "chatsan-laughs" }, // Frontier: add period + { "lol.", "chatsan-laughs" }, // Frontier: add period + { "lel.", "chatsan-laughs" }, // Frontier: add period + { "kek.", "chatsan-laughs" }, // Frontier: add period + { "rofl.", "chatsan-laughs" }, // Frontier: add period { "o7", "chatsan-salutes" }, { ";_;7", "chatsan-tearfully-salutes"}, - { "idk", "chatsan-shrugs" }, + { "idk.", "chatsan-shrugs" }, // Frontier: add period { ";)", "chatsan-winks" }, { ";]", "chatsan-winks" }, { "(;", "chatsan-winks" }, From 62c940d90f0f6f135229e009344ae0e546ce2c48 Mon Sep 17 00:00:00 2001 From: Whatstone Date: Sun, 20 Oct 2024 09:34:27 -0400 Subject: [PATCH 2/2] Move emote sanitization above cap/punct san. --- .../Chat/Managers/ChatSanitizationManager.cs | 44 +++++++++---------- Content.Server/Chat/Systems/ChatSystem.cs | 4 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Content.Server/Chat/Managers/ChatSanitizationManager.cs b/Content.Server/Chat/Managers/ChatSanitizationManager.cs index f6c83ba6f8e..634d8cdefab 100644 --- a/Content.Server/Chat/Managers/ChatSanitizationManager.cs +++ b/Content.Server/Chat/Managers/ChatSanitizationManager.cs @@ -30,14 +30,14 @@ public sealed class ChatSanitizationManager : IChatSanitizationManager { ")=", "chatsan-frowns" }, { "]:", "chatsan-frowns" }, { "]=", "chatsan-frowns" }, - { ":D.", "chatsan-smiles-widely" }, // Frontier: add period + { ":D", "chatsan-smiles-widely" }, { "D:", "chatsan-frowns-deeply" }, - { ":O.", "chatsan-surprised" }, // Frontier: add period + { ":O", "chatsan-surprised" }, { ":3", "chatsan-smiles" }, //nope - { ":S.", "chatsan-uncertain" }, // Frontier: add period + { ":S", "chatsan-uncertain" }, { ":>", "chatsan-grins" }, { ":<", "chatsan-pouts" }, - { "xD.", "chatsan-laughs" }, // Frontier: add period + { "xD", "chatsan-laughs" }, { ":'(", "chatsan-cries" }, { ":'[", "chatsan-cries" }, { "='(", "chatsan-cries" }, @@ -48,35 +48,35 @@ public sealed class ChatSanitizationManager : IChatSanitizationManager { "]'=", "chatsan-cries" }, { ";-;", "chatsan-cries" }, { ";_;", "chatsan-cries" }, - { "qwq.", "chatsan-cries" }, // Frontier: add period - { ":u.", "chatsan-smiles-smugly" }, // Frontier: add period - { ":v.", "chatsan-smiles-smugly" }, // Frontier: add period - { ">:i.", "chatsan-annoyed" }, // Frontier: add period - { ":i.", "chatsan-sighs" }, // Frontier: add period + { "qwq", "chatsan-cries" }, + { ":u", "chatsan-smiles-smugly" }, + { ":v", "chatsan-smiles-smugly" }, + { ">:i", "chatsan-annoyed" }, + { ":i", "chatsan-sighs" }, { ":|", "chatsan-sighs" }, - { ":p.", "chatsan-stick-out-tongue" }, // Frontier: add period - { ";p.", "chatsan-stick-out-tongue" }, // Frontier: add period - { ":b.", "chatsan-stick-out-tongue" }, // Frontier: add period + { ":p", "chatsan-stick-out-tongue" }, + { ";p", "chatsan-stick-out-tongue" }, + { ":b", "chatsan-stick-out-tongue" }, { "0-0", "chatsan-wide-eyed" }, - { "o-o.", "chatsan-wide-eyed" }, // Frontier: add period - { "o.o.", "chatsan-wide-eyed" }, // Frontier: add period + { "o-o", "chatsan-wide-eyed" }, + { "o.o", "chatsan-wide-eyed" }, { "._.", "chatsan-surprised" }, { ".-.", "chatsan-confused" }, { "-_-", "chatsan-unimpressed" }, - { "smh.", "chatsan-unimpressed" }, // Frontier: add period + { "smh", "chatsan-unimpressed" }, { "o/", "chatsan-waves" }, { "^^/", "chatsan-waves" }, { ":/", "chatsan-uncertain" }, { ":\\", "chatsan-uncertain" }, - { "lmao.", "chatsan-laughs" }, // Frontier: add period - { "lmfao.", "chatsan-laughs" }, // Frontier: add period - { "lol.", "chatsan-laughs" }, // Frontier: add period - { "lel.", "chatsan-laughs" }, // Frontier: add period - { "kek.", "chatsan-laughs" }, // Frontier: add period - { "rofl.", "chatsan-laughs" }, // Frontier: add period + { "lmao", "chatsan-laughs" }, + { "lmfao", "chatsan-laughs" }, + { "lol", "chatsan-laughs" }, + { "lel", "chatsan-laughs" }, + { "kek", "chatsan-laughs" }, + { "rofl", "chatsan-laughs" }, { "o7", "chatsan-salutes" }, { ";_;7", "chatsan-tearfully-salutes"}, - { "idk.", "chatsan-shrugs" }, // Frontier: add period + { "idk", "chatsan-shrugs" }, { ";)", "chatsan-winks" }, { ";]", "chatsan-winks" }, { "(;", "chatsan-winks" }, diff --git a/Content.Server/Chat/Systems/ChatSystem.cs b/Content.Server/Chat/Systems/ChatSystem.cs index a582bfe80b0..8e4509d7115 100644 --- a/Content.Server/Chat/Systems/ChatSystem.cs +++ b/Content.Server/Chat/Systems/ChatSystem.cs @@ -756,6 +756,8 @@ private string SanitizeInGameICMessage(EntityUid source, string message, out str var newMessage = message.Trim(); newMessage = SanitizeMessageReplaceWords(newMessage); + _sanitizer.TrySanitizeOutSmilies(newMessage, source, out newMessage, out emoteStr); // Frontier: moved up from bottom of function + if (capitalize) newMessage = SanitizeMessageCapital(newMessage); if (capitalizeTheWordI) @@ -763,8 +765,6 @@ private string SanitizeInGameICMessage(EntityUid source, string message, out str if (punctuate) newMessage = SanitizeMessagePeriod(newMessage); - _sanitizer.TrySanitizeOutSmilies(newMessage, source, out newMessage, out emoteStr); - return newMessage; }