Merge pull request #3099 from skykatik/patch-2

Removing spaces at start and end of a message (trim)
This commit is contained in:
Anuken 2020-10-30 10:29:42 -04:00 committed by GitHub
commit 17fd3d0bc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -163,15 +163,16 @@ public class ChatFragment extends Table{
Draw.color();
if(fadetime > 0 && !shown)
if(fadetime > 0 && !shown){
fadetime -= Time.delta / 180f;
}
}
private void sendMessage(){
String message = chatfield.getText();
String message = chatfield.getText().trim();
clearChatInput();
if(message.replace(" ", "").isEmpty()) return;
if(message.isEmpty()) return;
history.insert(1, message);