diff options
author | steckbrief <steckbrief@chefmail.de> | 2017-01-04 19:41:20 +0100 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2017-01-04 19:41:20 +0100 |
commit | 95cb2394154a287afcd295590d741096985ff69a (patch) | |
tree | 51f0b10fa41844885fc4ec40164b80e5892e3316 /src/main/java/eu/siacs/conversations/persistance/FileBackend.java | |
parent | b85035c2bf57de75280ae0b4eedeff6fbf87e9eb (diff) |
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
Diffstat (limited to 'src/main/java/eu/siacs/conversations/persistance/FileBackend.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/persistance/FileBackend.java | 13 |
1 files changed, 12 insertions, 1 deletions
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) { |