aboutsummaryrefslogtreecommitdiff
path: root/lib/mxcreply.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-26 12:50:30 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-29 08:17:56 +0200
commitc2d87291dbf8bd240e3e96138ec52aa5da22416b (patch)
tree86cc1e5473383780ac9343ec8aeea578cd0356ff /lib/mxcreply.cpp
parent841846ea5efad80ce20e0d42b1885def224e58ad (diff)
downloadlibquotient-c2d87291dbf8bd240e3e96138ec52aa5da22416b.tar.gz
libquotient-c2d87291dbf8bd240e3e96138ec52aa5da22416b.zip
Move encryptFile/decryptFile out of EncryptedFileMetadata
These are not operations on EncryptedFileMetadata but rather on a combination of EncryptedFileMetadata and ciphertext. If C++ had multimethods these could be bound to such a combination.
Diffstat (limited to 'lib/mxcreply.cpp')
-rw-r--r--lib/mxcreply.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mxcreply.cpp b/lib/mxcreply.cpp
index b7993ad5..4174cfd8 100644
--- a/lib/mxcreply.cpp
+++ b/lib/mxcreply.cpp
@@ -47,9 +47,9 @@ MxcReply::MxcReply(QNetworkReply* reply, Room* room, const QString &eventId)
if(!d->m_encryptedFile.has_value()) {
d->m_device = d->m_reply;
} else {
- EncryptedFileMetadata file = *d->m_encryptedFile;
auto buffer = new QBuffer(this);
- buffer->setData(file.decryptFile(d->m_reply->readAll()));
+ buffer->setData(
+ decryptFile(d->m_reply->readAll(), *d->m_encryptedFile));
buffer->open(ReadOnly);
d->m_device = buffer;
}