clear encrypted messages on reinit
This commit is contained in:
parent
96bbd16ca5
commit
8d306ac64f
|
@ -35,6 +35,7 @@ import net.java.otr4j.session.SessionStatus;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.NoSuchElementException;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
|
|
||||||
import eu.siacs.conversations.R;
|
import eu.siacs.conversations.R;
|
||||||
|
@ -503,6 +504,8 @@ public class ConversationFragment extends Fragment {
|
||||||
}
|
}
|
||||||
this.activity = (ConversationActivity) getActivity();
|
this.activity = (ConversationActivity) getActivity();
|
||||||
this.conversation = conversation;
|
this.conversation = conversation;
|
||||||
|
this.mDecryptJobRunning = false;
|
||||||
|
this.mEncryptedMessages.clear();
|
||||||
if (this.conversation.getMode() == Conversation.MODE_MULTI) {
|
if (this.conversation.getMode() == Conversation.MODE_MULTI) {
|
||||||
this.conversation.setNextCounterpart(null);
|
this.conversation.setNextCounterpart(null);
|
||||||
}
|
}
|
||||||
|
@ -626,7 +629,11 @@ public class ConversationFragment extends Fragment {
|
||||||
@Override
|
@Override
|
||||||
public void success(Message message) {
|
public void success(Message message) {
|
||||||
mDecryptJobRunning = false;
|
mDecryptJobRunning = false;
|
||||||
|
try {
|
||||||
mEncryptedMessages.remove();
|
mEncryptedMessages.remove();
|
||||||
|
} catch (final NoSuchElementException ignored) {
|
||||||
|
|
||||||
|
}
|
||||||
activity.xmppConnectionService.updateMessage(message);
|
activity.xmppConnectionService.updateMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -634,7 +641,11 @@ public class ConversationFragment extends Fragment {
|
||||||
public void error(int error, Message message) {
|
public void error(int error, Message message) {
|
||||||
message.setEncryption(Message.ENCRYPTION_DECRYPTION_FAILED);
|
message.setEncryption(Message.ENCRYPTION_DECRYPTION_FAILED);
|
||||||
mDecryptJobRunning = false;
|
mDecryptJobRunning = false;
|
||||||
|
try {
|
||||||
mEncryptedMessages.remove();
|
mEncryptedMessages.remove();
|
||||||
|
} catch (final NoSuchElementException ignored) {
|
||||||
|
|
||||||
|
}
|
||||||
activity.xmppConnectionService.updateConversationUi();
|
activity.xmppConnectionService.updateConversationUi();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue