diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-05-31 19:16:23 +0200 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-05-31 19:16:23 +0200 |
commit | ec75d2d0e9601dcf32387120ca67135ac7e7f472 (patch) | |
tree | 146484ece089a8293dc30505b0c2380374e5fac7 /lib/eventitem.cpp | |
parent | 945b1ab33c92b7b13e2c6b6ebc1f56c5caee0f79 (diff) | |
parent | a7c43995c3a47bbbac8d862f69f9229eb39f4ed6 (diff) | |
download | libquotient-ec75d2d0e9601dcf32387120ca67135ac7e7f472.tar.gz libquotient-ec75d2d0e9601dcf32387120ca67135ac7e7f472.zip |
Merge branch 'dev' into update-api-update
Diffstat (limited to 'lib/eventitem.cpp')
-rw-r--r-- | lib/eventitem.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/lib/eventitem.cpp b/lib/eventitem.cpp index 302ae053..a2e2a156 100644 --- a/lib/eventitem.cpp +++ b/lib/eventitem.cpp @@ -8,32 +8,23 @@ using namespace Quotient; -void PendingEventItem::setFileUploaded(const QUrl& remoteUrl) +void PendingEventItem::setFileUploaded(const FileSourceInfo& uploadedFileData) { // TODO: eventually we might introduce hasFileContent to RoomEvent, // and unify the code below. if (auto* rme = getAs<RoomMessageEvent>()) { Q_ASSERT(rme->hasFileContent()); - rme->editContent([remoteUrl](EventContent::TypedBase& ec) { - ec.fileInfo()->url = remoteUrl; + rme->editContent([&uploadedFileData](EventContent::TypedBase& ec) { + ec.fileInfo()->source = uploadedFileData; }); } if (auto* rae = getAs<RoomAvatarEvent>()) { Q_ASSERT(rae->content().fileInfo()); - rae->editContent( - [remoteUrl](EventContent::FileInfo& fi) { fi.url = 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; + rae->editContent([&uploadedFileData](EventContent::FileInfo& fi) { + fi.source = uploadedFileData; }); } + setStatus(EventStatus::FileUploaded); } // Not exactly sure why but this helps with the linker not finding |