From af3c106dc8c8f59b880dbb1768cde0bb2746cbd6 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 30 Dec 2019 00:14:52 +0100 Subject: [PATCH] reset file to normal message when attempting re-download after delete fixes: #3604 --- .../siacs/conversations/http/HttpDownloadConnection.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java index bd52e8ad2..b494c7ab0 100644 --- a/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java +++ b/src/main/java/eu/siacs/conversations/http/HttpDownloadConnection.java @@ -72,6 +72,15 @@ public class HttpDownloadConnection implements Transferable { } public void init(boolean interactive) { + if (message.isDeleted()) { + if (message.getType() == Message.TYPE_PRIVATE_FILE) { + message.setType(Message.TYPE_PRIVATE); + } else if (message.isFileOrImage()) { + message.setType(Message.TYPE_TEXT); + } + message.setDeleted(false); + mXmppConnectionService.updateMessage(message); + } this.message.setTransferable(this); try { final Message.FileParams fileParams = message.getFileParams();