trim chat messages

This commit is contained in:
in0finite 2021-02-20 21:57:52 +01:00
parent 4db2437dfc
commit 2f47dbf5d7
2 changed files with 5 additions and 0 deletions

View file

@ -105,6 +105,8 @@ namespace SanAndreasUnity.Chat
if (!NetStatus.IsServerStarted) if (!NetStatus.IsServerStarted)
return; return;
msg = msg.Trim();
foreach (var player in Player.AllPlayers) { foreach (var player in Player.AllPlayers) {
SendChatMessageToPlayer ( player, msg, sender ); SendChatMessageToPlayer ( player, msg, sender );
} }

View file

@ -25,6 +25,7 @@ namespace SanAndreasUnity.Chat
Player p = m_player; Player p = m_player;
msg = msg.Trim();
// Remove tags. // Remove tags.
msg = msg.Replace ("<", ""); // the only easy way :D msg = msg.Replace ("<", ""); // the only easy way :D
@ -51,6 +52,8 @@ namespace SanAndreasUnity.Chat
return; return;
} }
msg = msg.Trim();
onChatMessageReceivedOnLocalPlayer (new ChatMessage (msg, sender)); onChatMessageReceivedOnLocalPlayer (new ChatMessage (msg, sender));
} }