From 6d474b77f15eb3040d59580ebd70e52f297fd34a Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Sun, 8 Jul 2018 21:24:44 +0300 Subject: [PATCH] Fix variable shadowing that caused the key response to be null --- src/Olm.cpp | 5 +++-- src/timeline/TimelineView.cc | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Olm.cpp b/src/Olm.cpp index 67e375b5..cf54f4d4 100644 --- a/src/Olm.cpp +++ b/src/Olm.cpp @@ -494,7 +494,7 @@ send_megolm_key_to_device(const std::string &user_id, auto olm_session = olm::client()->create_outbound_session( pks.curve25519, device.begin()->at("key")); - auto device_msg = olm::client()->create_olm_encrypted_content( + device_msg = olm::client()->create_olm_encrypted_content( olm_session.get(), room_key, pks.curve25519); cache::client()->saveOlmSession(pks.curve25519, @@ -511,7 +511,8 @@ send_megolm_key_to_device(const std::string &user_id, body["messages"][user_id][device_id] = device_msg; - nhlog::net()->info("send_to_device: {}", user_id); + nhlog::net()->info( + "sending m.room_key event to {}:{}", user_id, device_id); http::v2::client()->send_to_device( "m.room.encrypted", body, [user_id](mtx::http::RequestErr err) { if (err) { diff --git a/src/timeline/TimelineView.cc b/src/timeline/TimelineView.cc index ee7b9a86..b156b732 100644 --- a/src/timeline/TimelineView.cc +++ b/src/timeline/TimelineView.cc @@ -1450,5 +1450,7 @@ TimelineView::handleClaimedKeys(std::shared_ptr keeper, "message: {}", err->matrix_error.error); } + + (void)keeper; }); }