From 634cf595279a29ecd3bc3568052922b44a208df5 Mon Sep 17 00:00:00 2001 From: mirrorcult Date: Fri, 1 Apr 2022 00:08:26 -0700 Subject: [PATCH] Fix incorrectly ported emote sanitization (#7370) --- Content.Server/Chat/ChatSystem.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Content.Server/Chat/ChatSystem.cs b/Content.Server/Chat/ChatSystem.cs index 36a60b8a17..77242b9928 100644 --- a/Content.Server/Chat/ChatSystem.cs +++ b/Content.Server/Chat/ChatSystem.cs @@ -82,22 +82,21 @@ public sealed class ChatSystem : EntitySystem return; } + // Sus + if (player?.AttachedEntity is { Valid: true } entity && source != entity) + { + return; + } + if (!CanSendInGame(message, shell, player)) return; message = SanitizeInGameICMessage(source, message, out var emoteStr); - // Is this -actually- an emote, and is a player sending it? + // Was there an emote in the message? If so, send it. if (player != null && emoteStr != message && emoteStr != null) { SendEntityEmote(source, emoteStr, hideChat); - return; - } - - // Sus - if (player?.AttachedEntity is { Valid: true } entity && source != entity) - { - return; } // Otherwise, send whatever type.