From 19cd1ef23438829b36b189eca18cbb98ddf5fbae Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 15 Jun 2016 14:29:25 +0200 Subject: replace corrected messages in decryption queue --- .../java/eu/siacs/conversations/crypto/PgpDecryptionService.java | 5 +++++ src/main/java/eu/siacs/conversations/parser/MessageParser.java | 1 + 2 files changed, 6 insertions(+) (limited to 'src/main/java/eu') diff --git a/src/main/java/eu/siacs/conversations/crypto/PgpDecryptionService.java b/src/main/java/eu/siacs/conversations/crypto/PgpDecryptionService.java index 45dfd7d92..07de11649 100644 --- a/src/main/java/eu/siacs/conversations/crypto/PgpDecryptionService.java +++ b/src/main/java/eu/siacs/conversations/crypto/PgpDecryptionService.java @@ -71,6 +71,11 @@ public class PgpDecryptionService { this.pendingNotifications.removeAll(discards); } + public synchronized void discard(Message message) { + this.messages.remove(message); + this.pendingNotifications.remove(message); + } + protected synchronized void decryptNext() { if (pendingIntent == null && getOpenPgpApi() != null diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java index 1dd8026ba..f965e561f 100644 --- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java +++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java @@ -483,6 +483,7 @@ public class MessageParser extends AbstractParser implements OnMessagePacketRece sendMessageReceipts(account, packet); } if (replacedMessage.getEncryption() == Message.ENCRYPTION_PGP) { + conversation.getAccount().getPgpDecryptionService().discard(replacedMessage); conversation.getAccount().getPgpDecryptionService().decrypt(replacedMessage, false); } return; -- cgit v1.2.3