From 0435f9278047dae73f1502e30c9978ce91ef9e96 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 15 Jun 2016 12:44:29 +0200 Subject: delay notification until after pgp decryption --- .../java/eu/siacs/conversations/http/HttpDownloadConnection.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/eu/siacs/conversations/http') diff --git a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java index 92cc2c664..c46f2b977 100644 --- a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java +++ b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java @@ -132,11 +132,12 @@ public class HttpDownloadConnection implements Transferable { mXmppConnectionService.getFileBackend().updateMediaScanner(file); message.setTransferable(null); mHttpConnectionManager.finishConnection(this); + boolean notify = acceptedAutomatically && !message.isRead(); if (message.getEncryption() == Message.ENCRYPTION_PGP) { - message.getConversation().getAccount().getPgpDecryptionService().decrypt(message); + notify = message.getConversation().getAccount().getPgpDecryptionService().decrypt(message, notify); } mXmppConnectionService.updateConversationUi(); - if (acceptedAutomatically) { + if (notify) { mXmppConnectionService.getNotificationService().push(message); } } -- cgit v1.2.3