Update ChatFragment.java

This will avoid exceeding the message length limit if player send a message with spaces in end/start message
This commit is contained in:
Skat
2020-10-24 23:34:18 +03:00
committed by GitHub
parent 79ace277ed
commit 7b8a9ff15e

View File

@@ -168,10 +168,10 @@ public class ChatFragment extends Table{
} }
private void sendMessage(){ private void sendMessage(){
String message = chatfield.getText(); String message = chatfield.getText().trim();
clearChatInput(); clearChatInput();
if(message.replace(" ", "").isEmpty()) return; if(message.isEmpty()) return;
history.insert(1, message); history.insert(1, message);