summary refs log tree commit diff
path: root/src/timeline/EventStore.cpp
diff options
context:
space:
mode:
authorDeepBlueV7.X <nicolas.werner@hotmail.de>2021-06-25 09:39:15 +0000
committerGitHub <noreply@github.com>2021-06-25 09:39:15 +0000
commit36f0e044398535143f24bbf2850df9e5b2947770 (patch)
treed8de79c75fb3033b4db2370745aefea7c0fe6616 /src/timeline/EventStore.cpp
parentMerge pull request #611 from balsoft/allow-edits-of-pending-messages (diff)
parentfix sort by unread not getting persisted (diff)
downloadnheko-36f0e044398535143f24bbf2850df9e5b2947770.tar.xz
Merge pull request #610 from Nheko-Reborn/spaces
Show some spaces in the community sidebar
Diffstat (limited to 'src/timeline/EventStore.cpp')
-rw-r--r--src/timeline/EventStore.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/timeline/EventStore.cpp b/src/timeline/EventStore.cpp

index 04f7ef76..9a91ff79 100644 --- a/src/timeline/EventStore.cpp +++ b/src/timeline/EventStore.cpp
@@ -675,6 +675,9 @@ EventStore::decryptEvent(const IdIndex &idx, index.room_id, index.session_id, e.sender); + // we may not want to request keys during initial sync and such + if (suppressKeyRequests) + break; // TODO: Check if this actually works and look in key backup auto copy = e; copy.room_id = room_id_; @@ -816,6 +819,18 @@ EventStore::decryptEvent(const IdIndex &idx, return asCacheEntry(std::move(decryptionResult.event.value())); } +void +EventStore::enableKeyRequests(bool suppressKeyRequests_) +{ + if (!suppressKeyRequests_) { + for (const auto &key : decryptedEvents_.keys()) + if (key.room == this->room_id_) + decryptedEvents_.remove(key); + suppressKeyRequests = false; + } else + suppressKeyRequests = true; +} + mtx::events::collections::TimelineEvents * EventStore::get(std::string id, std::string_view related_to, bool decrypt, bool resolve_edits) {