aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-10-04 13:37:36 +0200
committerChristian Schneppe <christian@pix-art.de>2018-10-04 13:37:36 +0200
commitc36d8b79113ab9d33e50323bb59e646d0664a688 (patch)
tree454e357eb3738d4f45303df812767031426a805b /src/main
parentb8f8ef9297d1705ff621a68d469f084942d15e83 (diff)
run through sendMessage() procedure instead of taking shortcut after returning from TrustKeys
The shortcut didn't take care of message edits and some other things
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index 5c7c4bb10..146fb6a42 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -885,11 +885,15 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
commitAttachments();
return;
}
- final String body = binding.textinput.getText().toString();
+ final Editable text = this.binding.textinput.getText();
+ final String body = text == null ? "" : text.toString();
final Conversation conversation = this.conversation;
if (body.length() == 0 || conversation == null) {
return;
}
+ if (conversation.getNextEncryption() == Message.ENCRYPTION_AXOLOTL && trustKeysIfNeeded(REQUEST_TRUST_KEYS_TEXT)) {
+ return;
+ }
final Message message;
if (conversation.getCorrectingMessage() == null) {
message = new Message(conversation, body, conversation.getNextEncryption());
@@ -914,11 +918,6 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
case Message.ENCRYPTION_PGP:
sendPgpMessage(message);
break;
- case Message.ENCRYPTION_AXOLOTL:
- if (!trustKeysIfNeeded(REQUEST_TRUST_KEYS_TEXT)) {
- sendMessage(message);
- }
- break;
default:
sendMessage(message);
}
@@ -987,9 +986,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
private void handlePositiveActivityResult(int requestCode, final Intent data) {
switch (requestCode) {
case REQUEST_TRUST_KEYS_TEXT:
- final String body = binding.textinput.getText().toString();
- Message message = new Message(conversation, body, conversation.getNextEncryption());
- sendMessage(message);
+ sendMessage();
break;
case REQUEST_TRUST_KEYS_ATTACHMENTS:
commitAttachments();