aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/persistance/FileBackend.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/persistance/FileBackend.java')
-rw-r--r--src/main/java/eu/siacs/conversations/persistance/FileBackend.java13
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) {