diff options
author | Tobias Fella <fella@posteo.de> | 2022-03-08 00:06:36 +0100 |
---|---|---|
committer | Tobias Fella <fella@posteo.de> | 2022-05-16 20:47:17 +0200 |
commit | efa450920e5fc338e771e653ca0889e948d04ee7 (patch) | |
tree | 215efb53d0e06ed660a97593d56ffb4868dbc2e2 /lib/eventitem.cpp | |
parent | 6f5ac9b7315d75692960e5eac7b1eb6867c0d203 (diff) | |
download | libquotient-efa450920e5fc338e771e653ca0889e948d04ee7.tar.gz libquotient-efa450920e5fc338e771e653ca0889e948d04ee7.zip |
Implement sending encrypted files
Diffstat (limited to 'lib/eventitem.cpp')
-rw-r--r-- | lib/eventitem.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/eventitem.cpp b/lib/eventitem.cpp index a2d65d8d..302ae053 100644 --- a/lib/eventitem.cpp +++ b/lib/eventitem.cpp @@ -26,6 +26,16 @@ void PendingEventItem::setFileUploaded(const QUrl& remoteUrl) setStatus(EventStatus::FileUploaded); } +void PendingEventItem::setEncryptedFile(const EncryptedFile& encryptedFile) +{ + if (auto* rme = getAs<RoomMessageEvent>()) { + Q_ASSERT(rme->hasFileContent()); + rme->editContent([encryptedFile](EventContent::TypedBase& ec) { + ec.fileInfo()->file = encryptedFile; + }); + } +} + // Not exactly sure why but this helps with the linker not finding // Quotient::EventStatus::staticMetaObject when building Quaternion #include "moc_eventitem.cpp" |