diff --git a/Assets/Scripts/Chat/ChatManager.cs b/Assets/Scripts/Chat/ChatManager.cs index f48fe2a8..9b1b8a93 100644 --- a/Assets/Scripts/Chat/ChatManager.cs +++ b/Assets/Scripts/Chat/ChatManager.cs @@ -105,6 +105,8 @@ namespace SanAndreasUnity.Chat if (!NetStatus.IsServerStarted) return; + msg = msg.Trim(); + foreach (var player in Player.AllPlayers) { SendChatMessageToPlayer ( player, msg, sender ); } diff --git a/Assets/Scripts/Chat/ChatSync.cs b/Assets/Scripts/Chat/ChatSync.cs index d5aaaee9..9b2fe3a7 100644 --- a/Assets/Scripts/Chat/ChatSync.cs +++ b/Assets/Scripts/Chat/ChatSync.cs @@ -25,6 +25,7 @@ namespace SanAndreasUnity.Chat Player p = m_player; + msg = msg.Trim(); // Remove tags. msg = msg.Replace ("<", ""); // the only easy way :D @@ -51,6 +52,8 @@ namespace SanAndreasUnity.Chat return; } + msg = msg.Trim(); + onChatMessageReceivedOnLocalPlayer (new ChatMessage (msg, sender)); }