aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-03-04 18:20:31 +0100
committerChristian Schneppe <christian@pix-art.de>2017-03-04 18:20:31 +0100
commitf9f2b6209c25b69303c6c691b5e8d745069d3abc (patch)
tree21027e0e8e9a0aa7093cfef7b6c1cc4c0d1f209e /src/main/java/de
parent8eff9bd35c8c2011cc92d8ccb722483f79b612a9 (diff)
fixed messages vanishing after pgp raised error on editing a message
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/pixart/messenger/entities/Conversation.java4
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConversationFragment.java4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java
index c23305b3e..7e75600f3 100644
--- a/src/main/java/de/pixart/messenger/entities/Conversation.java
+++ b/src/main/java/de/pixart/messenger/entities/Conversation.java
@@ -372,8 +372,10 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl
setAttribute(ATTRIBUTE_CRYPTO_TARGETS, acceptedTargets);
}
- public void setCorrectingMessage(Message correctingMessage) {
+ public boolean setCorrectingMessage(Message correctingMessage) {
+ boolean corrected = this.correctingMessage != null && correctingMessage == null;
this.correctingMessage = correctingMessage;
+ return corrected;
}
public Message getCorrectingMessage() {
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
index b91e90bbd..801c47e60 100644
--- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
+++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java
@@ -416,7 +416,6 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
message.setBody(body);
message.setEdited(message.getUuid());
message.setUuid(UUID.randomUUID().toString());
- conversation.setCorrectingMessage(null);
}
switch (conversation.getNextEncryption()) {
case Message.ENCRYPTION_OTR:
@@ -1108,7 +1107,8 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
}
protected void messageSent() {
- mEditMessage.setText("");
+ mEditMessage.getEditableText().clear();
+ conversation.setCorrectingMessage(null);
updateChatMsgHint();
new Handler().post(new Runnable() {
@Override