diff --git a/src/main/java/eu/siacs/conversations/entities/Conversation.java b/src/main/java/eu/siacs/conversations/entities/Conversation.java index b22d9f27..eaf01dd0 100644 --- a/src/main/java/eu/siacs/conversations/entities/Conversation.java +++ b/src/main/java/eu/siacs/conversations/entities/Conversation.java @@ -356,8 +356,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/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index fb3f3331..a8a1d0ba 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -395,7 +395,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: @@ -1073,7 +1072,8 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa protected void messageSent() { mSendingPgpMessage.set(false); - mEditMessage.setText(""); + mEditMessage.getEditableText().clear(); + conversation.setCorrectingMessage(null); updateChatMsgHint(); new Handler().post(new Runnable() { @Override