From bc7494473b57bfd3f98e5e0b24996e3579979f39 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Sat, 17 Oct 2020 00:12:26 +0200 Subject: [PATCH] Answer key requests for all our sessions --- src/Olm.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/Olm.cpp b/src/Olm.cpp index f4cb220..1d86b4d 100644 --- a/src/Olm.cpp +++ b/src/Olm.cpp @@ -500,12 +500,14 @@ handle_key_request_message(const mtx::events::DeviceEventwarn("session id of retrieved session doesn't match the request: " - "requested({}), ours({})", - req.content.session_id, - session.data.session_id); + MegolmSessionIndex index{}; + index.room_id = req.content.room_id; + index.session_id = req.content.session_id; + index.sender_key = olm::client()->identity_keys().curve25519; + + const auto session = cache::getInboundMegolmSession(index); + if (!session) { + nhlog::crypto()->warn("No session with id {} in db", req.content.session_id); return; } @@ -523,13 +525,14 @@ handle_key_request_message(const mtx::events::DeviceEvent