From 8064832dcaf9098ed7748fbdf3e21f3f6734cd28 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 20 May 2015 08:25:00 +0200 Subject: [PATCH] don't allow user to accidentally send empty messages --- build.gradle | 4 ++-- .../eu/siacs/conversations/ui/ConversationFragment.java | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 98b341d52..d572892d6 100644 --- a/build.gradle +++ b/build.gradle @@ -44,8 +44,8 @@ android { defaultConfig { minSdkVersion 14 targetSdkVersion 21 - versionCode 66 - versionName "1.4.0" + versionCode 67 + versionName "1.4.1" } compileOptions { diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 20fc17506..02f664db5 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -285,12 +285,11 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa private Message selectedMessage; private void sendMessage() { - if (this.conversation == null) { + final String body = mEditMessage.getText().toString(); + if (body.length() == 0 || this.conversation == null) { return; } - Message message = new Message(conversation, mEditMessage.getText() - .toString(), conversation.getNextEncryption(activity - .forceEncryption())); + Message message = new Message(conversation, body, conversation.getNextEncryption(activity.forceEncryption())); if (conversation.getMode() == Conversation.MODE_MULTI) { if (conversation.getNextCounterpart() != null) { message.setCounterpart(conversation.getNextCounterpart());