diff options
author | steckbrief <steckbrief@chefmail.de> | 2018-02-16 21:04:29 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2018-02-16 21:04:29 +0100 |
commit | 62bc6885db07423a434f945de9def863cb12b8c1 (patch) | |
tree | 0d60daca06a78d11546c02083c29f826581ae179 /src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download | |
parent | 84a2f8e41ac4d5a7ebc24f4eb5b99e9bc3029f1f (diff) |
introduces cancel status for file transfers, fixes NPE in file sharing after picture resize
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download')
2 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpFileDownloadCallback.java b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpFileDownloadCallback.java index 2c31754c..18c13a3f 100644 --- a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpFileDownloadCallback.java +++ b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpFileDownloadCallback.java @@ -41,6 +41,7 @@ public class HttpFileDownloadCallback implements Callback { StreamUtil.close(os); FileBackend.updateMediaScanner(file, XmppConnectionServiceAccessor.xmppConnectionService); this.entity.transferred(); + MessageUtil.updateFileParams(this.entity.getMessage()); changeStatus(FileStatus.DOWNLOADED); } else { Logging.e("http-download", "Failed to retrieve file from remote host. HTTP response: " + response.code() + ", " + response.body().string()); diff --git a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java index 8d23d9c0..1313bcca 100644 --- a/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java +++ b/src/main/java/de/thedevstack/conversationsplus/services/filetransfer/http/download/HttpRetrieveHead.java @@ -41,7 +41,7 @@ public class HttpRetrieveHead implements Http, Callback { if (null == this.url) { message.setTreatAsDownloadable(Message.Decision.NEVER); // TODO find sth better if (null != message.getFileParams()) { - MessageUtil.setAndSaveFileStatus(message, FileStatus.NOT_FOUND); + MessageUtil.setAndSaveFileStatus(message, FileStatus.UNDEFINED); } } } |