Fix capitalization of emotes (#7766)
This commit is contained in:
@@ -91,7 +91,9 @@ public sealed class ChatSystem : EntitySystem
|
||||
if (!CanSendInGame(message, shell, player))
|
||||
return;
|
||||
|
||||
message = SanitizeInGameICMessage(source, message, out var emoteStr);
|
||||
bool shouldCapitalize = (desiredType != InGameICChatType.Emote);
|
||||
|
||||
message = SanitizeInGameICMessage(source, message, out var emoteStr, shouldCapitalize);
|
||||
|
||||
// Was there an emote in the message? If so, send it.
|
||||
if (player != null && emoteStr != message && emoteStr != null)
|
||||
@@ -294,10 +296,11 @@ public sealed class ChatSystem : EntitySystem
|
||||
}
|
||||
|
||||
// ReSharper disable once InconsistentNaming
|
||||
private string SanitizeInGameICMessage(EntityUid source, string message, out string? emoteStr)
|
||||
private string SanitizeInGameICMessage(EntityUid source, string message, out string? emoteStr, bool capitalize = true)
|
||||
{
|
||||
var newMessage = message.Trim();
|
||||
newMessage = SanitizeMessageCapital(source, newMessage);
|
||||
if (capitalize)
|
||||
newMessage = SanitizeMessageCapital(source, newMessage);
|
||||
newMessage = FormattedMessage.EscapeText(newMessage);
|
||||
|
||||
_sanitizer.TrySanitizeOutSmilies(newMessage, source, out newMessage, out emoteStr);
|
||||
|
||||
@@ -65,6 +65,7 @@ public sealed class ChatSanitizationManager : IChatSanitizationManager
|
||||
{ "lel", "chatsan-laughs" },
|
||||
{ "kek", "chatsan-laughs" },
|
||||
{ "o7", "chatsan-salutes" },
|
||||
{ ";_;7", "chatsan-tearfully-salutes"},
|
||||
{ "idk", "chatsan-shrugs" }
|
||||
};
|
||||
|
||||
|
||||
@@ -18,4 +18,5 @@ chatsan-confused = looks confused
|
||||
chatsan-unimpressed = seems unimpressed
|
||||
chatsan-waves = waves
|
||||
chatsan-salutes = salutes
|
||||
chatsan-tearfully-salutes = tearfully salutes
|
||||
chatsan-shrugs = shrugs
|
||||
|
||||
Reference in New Issue
Block a user