diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-06-15 12:44:29 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2016-06-19 20:02:11 +0200 |
commit | 0435f9278047dae73f1502e30c9978ce91ef9e96 (patch) | |
tree | dca655fd0e38c5f9c520a9f22e167e9cc5a256b1 /src/main/java/eu/siacs/conversations/xmpp/jingle | |
parent | d12a57cbb362d6158c7b4c5f70074b3c829308ea (diff) |
delay notification until after pgp decryption
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java index 2d5b6433c..a2ddaa4ae 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleConnection.java @@ -102,9 +102,16 @@ public class JingleConnection implements Transferable { mXmppConnectionService.markMessage(message,Message.STATUS_RECEIVED); if (acceptedAutomatically) { message.markUnread(); - JingleConnection.this.mXmppConnectionService.getNotificationService().push(message); + if (message.getEncryption() == Message.ENCRYPTION_PGP) { + account.getPgpDecryptionService().decrypt(message, true); + } else { + JingleConnection.this.mXmppConnectionService.getNotificationService().push(message); + } } } else { + if (message.getEncryption() == Message.ENCRYPTION_PGP) { + account.getPgpDecryptionService().decrypt(message, false); + } if (message.getEncryption() == Message.ENCRYPTION_PGP || message.getEncryption() == Message.ENCRYPTION_DECRYPTED) { file.delete(); } @@ -112,8 +119,6 @@ public class JingleConnection implements Transferable { Log.d(Config.LOGTAG,"successfully transmitted file:" + file.getAbsolutePath()+" ("+file.getSha1Sum()+")"); if (message.getEncryption() != Message.ENCRYPTION_PGP) { mXmppConnectionService.getFileBackend().updateMediaScanner(file); - } else { - account.getPgpDecryptionService().decrypt(message); } } |