summary refs log tree commit diff
path: root/src/MxcImageProvider.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/MxcImageProvider.cpp')
-rw-r--r--src/MxcImageProvider.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/MxcImageProvider.cpp b/src/MxcImageProvider.cpp

index 556b019b..edf6ceb5 100644 --- a/src/MxcImageProvider.cpp +++ b/src/MxcImageProvider.cpp
@@ -5,7 +5,7 @@ void MxcImageResponse::run() { - if (m_requestedSize.isValid()) { + if (m_requestedSize.isValid() && !m_encryptionInfo) { QString fileName = QString("%1_%2x%3_crop") .arg(m_id) .arg(m_requestedSize.width()) @@ -65,7 +65,12 @@ MxcImageResponse::run() return; } - auto data = QByteArray(res.data(), res.size()); + auto temp = res; + if (m_encryptionInfo) + temp = mtx::crypto::to_string( + mtx::crypto::decrypt_file(temp, m_encryptionInfo.value())); + + auto data = QByteArray(temp.data(), temp.size()); m_image.loadFromData(data); m_image.setText("original filename", QString::fromStdString(originalFilename));