diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-12-01 11:18:55 +0100 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-12-01 11:18:55 +0100 |
commit | 8d306ac64fe7e0185d6553dd0f19aee62b64b07b (patch) | |
tree | 75a5ed78cf518f4fb75af52261c189cb624330a4 /src/main | |
parent | 96bbd16ca52f4225d4badf6a02041a8a98f0f039 (diff) |
clear encrypted messages on reinit
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 287d1636b..1d26ff8a7 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -35,6 +35,7 @@ import net.java.otr4j.session.SessionStatus; import java.util.ArrayList; import java.util.List; +import java.util.NoSuchElementException; import java.util.concurrent.ConcurrentLinkedQueue; import eu.siacs.conversations.R; @@ -503,6 +504,8 @@ public class ConversationFragment extends Fragment { } this.activity = (ConversationActivity) getActivity(); this.conversation = conversation; + this.mDecryptJobRunning = false; + this.mEncryptedMessages.clear(); if (this.conversation.getMode() == Conversation.MODE_MULTI) { this.conversation.setNextCounterpart(null); } @@ -626,7 +629,11 @@ public class ConversationFragment extends Fragment { @Override public void success(Message message) { mDecryptJobRunning = false; - mEncryptedMessages.remove(); + try { + mEncryptedMessages.remove(); + } catch (final NoSuchElementException ignored) { + + } activity.xmppConnectionService.updateMessage(message); } @@ -634,7 +641,11 @@ public class ConversationFragment extends Fragment { public void error(int error, Message message) { message.setEncryption(Message.ENCRYPTION_DECRYPTION_FAILED); mDecryptJobRunning = false; - mEncryptedMessages.remove(); + try { + mEncryptedMessages.remove(); + } catch (final NoSuchElementException ignored) { + + } activity.xmppConnectionService.updateConversationUi(); } }); |