aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-06-15 14:29:25 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-06-15 14:29:25 +0200
commit60588af8257290fdf47e500e7ff642ee199e0cf9 (patch)
tree8d4a4401d56e07372d5823123b45150d0584a0ab /src/main/java/eu
parentf99f21ab9ba28c8e13f03f76d32d32f8c5334b4f (diff)
replace corrected messages in decryption queue
Diffstat (limited to 'src/main/java/eu')
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/PgpDecryptionService.java5
-rw-r--r--src/main/java/eu/siacs/conversations/parser/MessageParser.java1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/crypto/PgpDecryptionService.java b/src/main/java/eu/siacs/conversations/crypto/PgpDecryptionService.java
index 73da1fb9..082c7474 100644
--- a/src/main/java/eu/siacs/conversations/crypto/PgpDecryptionService.java
+++ b/src/main/java/eu/siacs/conversations/crypto/PgpDecryptionService.java
@@ -64,6 +64,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 1dd8026b..f965e561 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;