From 95cb2394154a287afcd295590d741096985ff69a Mon Sep 17 00:00:00 2001 From: steckbrief Date: Wed, 4 Jan 2017 19:41:20 +0100 Subject: Added columns to fileparams table: url, original file name, key and iv auto download of files moved from MessageParser to MessageAdapter download and open file representation cleaned up --- .../eu/siacs/conversations/persistance/FileBackend.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/main/java/eu/siacs/conversations/persistance/FileBackend.java') diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index 6f99ef55..c7cf722d 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -108,7 +108,18 @@ public class FileBackend { } public static DownloadableFile getFile(Message message, boolean decrypted) { - return new DownloadableFile(getFilePath(message, decrypted)); + DownloadableFile downloadableFile = new DownloadableFile(getFilePath(message, decrypted)); + FileParams fileParams = message.getFileParams(); + if (null != fileParams) { + if (null != fileParams.getKey()) { + downloadableFile.setKey(fileParams.getKey()); + } + if (null != fileParams.getIv()) { + downloadableFile.setIv(fileParams.getIv()); + } + } + + return downloadableFile; } protected static String getFilePath(Message message, String extension) { -- cgit v1.2.3