From eadb1e127b81005b8d83a86197e6c71ce0115fcc Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 30 Mar 2022 09:59:42 +0200 Subject: [PATCH] disable knownFileSize on re-download for pgp encrypted files --- .../siacs/conversations/http/HttpDownloadConnection.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java index 31ba810a4..032496842 100644 --- a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java +++ b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java @@ -102,7 +102,12 @@ public class HttpDownloadConnection implements Transferable { if (this.message.getEncryption() == Message.ENCRYPTION_AXOLOTL && this.file.getKey() == null) { this.message.setEncryption(Message.ENCRYPTION_NONE); } - final Long knownFileSize = message.getFileParams().size; + final Long knownFileSize; + if (message.getEncryption() == Message.ENCRYPTION_PGP || message.getEncryption() == Message.ENCRYPTION_DECRYPTED) { + knownFileSize = null; + } else { + knownFileSize = message.getFileParams().size; + } Log.d(Config.LOGTAG,"knownFileSize: "+knownFileSize+", body="+message.getBody()); if (knownFileSize != null && interactive) { if (message.getEncryption() == Message.ENCRYPTION_AXOLOTL