Implement decryption of images
It is a bit of a hack, but it works...
This commit is contained in:
parent
a689118d71
commit
5bfdaff778
6 changed files with 57 additions and 9 deletions
|
|
@ -673,6 +673,19 @@ TimelineModel::internalAddEvents(
|
|||
continue; // don't insert redaction into timeline
|
||||
}
|
||||
|
||||
if (auto event =
|
||||
boost::get<mtx::events::EncryptedEvent<mtx::events::msg::Encrypted>>(&e)) {
|
||||
auto temp = decryptEvent(*event).event;
|
||||
auto encInfo = boost::apply_visitor(
|
||||
[](const auto &ev) -> boost::optional<mtx::crypto::EncryptedFile> {
|
||||
return eventEncryptionInfo(ev);
|
||||
},
|
||||
temp);
|
||||
|
||||
if (encInfo)
|
||||
emit newEncryptedImage(encInfo.value());
|
||||
}
|
||||
|
||||
this->events.insert(id, e);
|
||||
ids.push_back(id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue