Stop radio channels from being malformed. (#9210)

This commit is contained in:
Leon Friedrich
2022-06-27 15:56:38 +12:00
committed by GitHub
parent cb2a07a5ce
commit 07a35e8363

View File

@@ -224,12 +224,13 @@ public sealed partial class ChatSystem : SharedChatSystem
#region Private API
private void SendEntitySpeak(EntityUid source, string message, bool hideChat = false)
private void SendEntitySpeak(EntityUid source, string originalMessage, bool hideChat = false)
{
if (!_actionBlocker.CanSpeak(source)) return;
message = TransformSpeech(source, message);
(message, var channel) = GetRadioPrefix(source, message);
var (message, channel) = GetRadioPrefix(source, originalMessage);
message = TransformSpeech(source, message);
if (channel != null)
_listener.PingListeners(source, message, channel);
@@ -241,7 +242,11 @@ public sealed partial class ChatSystem : SharedChatSystem
var ev = new EntitySpokeEvent(message);
RaiseLocalEvent(source, ev);
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Say from {ToPrettyString(source):user}: {message}");
if (originalMessage == message)
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Say from {ToPrettyString(source):user}: {originalMessage}.");
else
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Say from {ToPrettyString(source):user}, original: {originalMessage}, transformed: {message}.");
}
private void SendEntityWhisper(EntityUid source, string message, bool hideChat = false)