diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-01-27 20:29:06 +0100 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2021-01-27 20:29:06 +0100 |
commit | 5fbf17f6ec6a0a31fbb6ee874c56db507b02ffe9 (patch) | |
tree | f3300adb50877e426750efdd1eb1d082fcb6140c /src/timeline | |
parent | Fix username completion deleting characters before it (diff) | |
download | nheko-5fbf17f6ec6a0a31fbb6ee874c56db507b02ffe9.tar.xz |
Fix request key loops
Diffstat (limited to 'src/timeline')
-rw-r--r-- | src/timeline/EventStore.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/timeline/EventStore.cpp b/src/timeline/EventStore.cpp index b16bf1d2..4748f9c0 100644 --- a/src/timeline/EventStore.cpp +++ b/src/timeline/EventStore.cpp @@ -242,7 +242,9 @@ EventStore::receivedSessionKey(const std::string &session_id) return; auto request = pending_key_requests.at(session_id); - pending_key_requests.erase(session_id); + + // Don't request keys again until Nheko is restarted (for now) + pending_key_requests[session_id].events.clear(); olm::send_key_request_for(request.events.front(), request.request_id, true); @@ -778,7 +780,8 @@ EventStore::fetchMore() if (cache::client()->previousBatchToken(room_id_) != opts.from) { nhlog::net()->warn("Cache cleared while fetching more messages, dropping " "/messages response"); - emit fetchedMore(); + if (!opts.to.empty()) + emit fetchedMore(); return; } if (err) { |