don't allow user to accidentally send empty messages

This commit is contained in:
Daniel Gultsch 2015-05-20 08:25:00 +02:00
parent 4f36aa39a4
commit 8064832dca
2 changed files with 5 additions and 6 deletions

View file

@ -44,8 +44,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 66
versionName "1.4.0"
versionCode 67
versionName "1.4.1"
}
compileOptions {

View file

@ -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());