aboutsummaryrefslogtreecommitdiff
path: root/lib/jobs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jobs')
-rw-r--r--lib/jobs/downloadfilejob.cpp13
-rw-r--r--lib/jobs/downloadfilejob.h5
2 files changed, 10 insertions, 8 deletions
diff --git a/lib/jobs/downloadfilejob.cpp b/lib/jobs/downloadfilejob.cpp
index d00fc5f4..85c235c7 100644
--- a/lib/jobs/downloadfilejob.cpp
+++ b/lib/jobs/downloadfilejob.cpp
@@ -8,8 +8,9 @@
#include <QtNetwork/QNetworkReply>
#ifdef Quotient_E2EE_ENABLED
-# include <QtCore/QCryptographicHash>
-# include "events/encryptedfile.h"
+# include "events/filesourceinfo.h"
+
+# include <QtCore/QCryptographicHash>
#endif
using namespace Quotient;
@@ -26,7 +27,7 @@ public:
QScopedPointer<QFile> tempFile;
#ifdef Quotient_E2EE_ENABLED
- Omittable<EncryptedFile> encryptedFile;
+ Omittable<EncryptedFileMetadata> encryptedFile;
#endif
};
@@ -49,7 +50,7 @@ DownloadFileJob::DownloadFileJob(const QString& serverName,
#ifdef Quotient_E2EE_ENABLED
DownloadFileJob::DownloadFileJob(const QString& serverName,
const QString& mediaId,
- const EncryptedFile& file,
+ const EncryptedFileMetadata& file,
const QString& localFilename)
: GetContentJob(serverName, mediaId)
, d(localFilename.isEmpty() ? makeImpl<Private>()
@@ -126,7 +127,7 @@ BaseJob::Status DownloadFileJob::prepareResult()
d->tempFile->seek(0);
QByteArray encrypted = d->tempFile->readAll();
- EncryptedFile file = *d->encryptedFile;
+ EncryptedFileMetadata file = *d->encryptedFile;
const auto decrypted = file.decryptFile(encrypted);
d->targetFile->write(decrypted);
d->tempFile->remove();
@@ -151,7 +152,7 @@ BaseJob::Status DownloadFileJob::prepareResult()
d->tempFile->seek(0);
const auto encrypted = d->tempFile->readAll();
- EncryptedFile file = *d->encryptedFile;
+ EncryptedFileMetadata file = *d->encryptedFile;
const auto decrypted = file.decryptFile(encrypted);
d->tempFile->write(decrypted);
} else {
diff --git a/lib/jobs/downloadfilejob.h b/lib/jobs/downloadfilejob.h
index ffa3d055..cbbfd244 100644
--- a/lib/jobs/downloadfilejob.h
+++ b/lib/jobs/downloadfilejob.h
@@ -4,7 +4,8 @@
#pragma once
#include "csapi/content-repo.h"
-#include "events/encryptedfile.h"
+
+#include "events/filesourceinfo.h"
namespace Quotient {
class QUOTIENT_API DownloadFileJob : public GetContentJob {
@@ -16,7 +17,7 @@ public:
const QString& localFilename = {});
#ifdef Quotient_E2EE_ENABLED
- DownloadFileJob(const QString& serverName, const QString& mediaId, const EncryptedFile& file, const QString& localFilename = {});
+ DownloadFileJob(const QString& serverName, const QString& mediaId, const EncryptedFileMetadata& file, const QString& localFilename = {});
#endif
QString targetFileName() const;