Move away from using an event loop to access secrets
Fixes messages in room flickering and being stuck fixes #760 relates to #770 relates to #789
This commit is contained in:
parent
d112d6b11f
commit
5ca1fb18bb
11 changed files with 267 additions and 208 deletions
|
|
@ -259,15 +259,20 @@ SelfVerificationStatus::invalidate()
|
|||
using namespace mtx::secret_storage;
|
||||
|
||||
nhlog::db()->info("Invalidating self verification status");
|
||||
if (cache::isInitialized()) {
|
||||
return;
|
||||
}
|
||||
|
||||
this->hasSSSS_ = false;
|
||||
emit hasSSSSChanged();
|
||||
|
||||
auto keys = cache::client()->userKeys(http::client()->user_id().to_string());
|
||||
if (!keys || keys->device_keys.find(http::client()->device_id()) == keys->device_keys.end()) {
|
||||
cache::client()->markUserKeysOutOfDate({http::client()->user_id().to_string()});
|
||||
cache::client()->query_keys(http::client()->user_id().to_string(),
|
||||
[](const UserKeyCache &, mtx::http::RequestErr) {});
|
||||
return;
|
||||
QTimer::singleShot(500, [] {
|
||||
cache::client()->markUserKeysOutOfDate({http::client()->user_id().to_string()});
|
||||
cache::client()->query_keys(http::client()->user_id().to_string(),
|
||||
[](const UserKeyCache &, mtx::http::RequestErr) {});
|
||||
});
|
||||
}
|
||||
|
||||
if (keys->master_keys.keys.empty()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue