diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-08-07 22:51:09 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-08-07 22:51:09 +0200 |
commit | 72bbad7485db6ac1803f81344c29b93d9fa70945 (patch) | |
tree | 6fb74f887102affa0d5a6f4fdac0b87c1881c6ad /src/timeline/EventStore.h | |
parent | Merge pull request #664 from govynnus/token-registration (diff) | |
download | nheko-72bbad7485db6ac1803f81344c29b93d9fa70945.tar.xz |
Show encryption errors in qml and add request keys button
Diffstat (limited to 'src/timeline/EventStore.h')
-rw-r--r-- | src/timeline/EventStore.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/timeline/EventStore.h b/src/timeline/EventStore.h index 7c404102..59c1c7c0 100644 --- a/src/timeline/EventStore.h +++ b/src/timeline/EventStore.h @@ -15,6 +15,7 @@ #include <mtx/responses/messages.hpp> #include <mtx/responses/sync.hpp> +#include "Olm.h" #include "Reaction.h" class EventStore : public QObject @@ -78,6 +79,9 @@ public: mtx::events::collections::TimelineEvents *get(int idx, bool decrypt = true); QVariantList reactions(const std::string &event_id); + olm::DecryptionErrorCode decryptionError(std::string id); + void requestSession(const mtx::events::EncryptedEvent<mtx::events::msg::Encrypted> &ev, + bool manual); int size() const { @@ -119,7 +123,7 @@ public slots: private: std::vector<mtx::events::collections::TimelineEvents> edits(const std::string &event_id); - mtx::events::collections::TimelineEvents *decryptEvent( + olm::DecryptionResult *decryptEvent( const IdIndex &idx, const mtx::events::EncryptedEvent<mtx::events::msg::Encrypted> &e); void handle_room_verification(mtx::events::collections::TimelineEvents event); @@ -129,7 +133,7 @@ private: uint64_t first = std::numeric_limits<uint64_t>::max(), last = std::numeric_limits<uint64_t>::max(); - static QCache<IdIndex, mtx::events::collections::TimelineEvents> decryptedEvents_; + static QCache<IdIndex, olm::DecryptionResult> decryptedEvents_; static QCache<Index, mtx::events::collections::TimelineEvents> events_; static QCache<IdIndex, mtx::events::collections::TimelineEvents> events_by_id_; @@ -137,6 +141,7 @@ private: { std::string request_id; std::vector<mtx::events::EncryptedEvent<mtx::events::msg::Encrypted>> events; + qint64 requested_at; }; std::map<std::string, PendingKeyRequests> pending_key_requests; |