From 9102a141f3f169c39b4fe87839e646eb68fd4b55 Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Fri, 15 Jun 2018 01:35:31 +0300 Subject: Handle OLM_MESSAGE type of messages properly --- src/timeline/TimelineView.cc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/timeline') diff --git a/src/timeline/TimelineView.cc b/src/timeline/TimelineView.cc index 8f3ad1a7..5841ebce 100644 --- a/src/timeline/TimelineView.cc +++ b/src/timeline/TimelineView.cc @@ -1329,18 +1329,21 @@ TimelineView::prepareEncryptedMessage(const PendingMessage &msg) auto otk = rd.second.begin()->at("key"); auto id_key = pks.curve25519; - auto session = - olm::client() - ->create_outbound_session(id_key, - otk); + auto s = olm::client() + ->create_outbound_session( + id_key, otk); auto device_msg = olm::client() ->create_olm_encrypted_content( - session.get(), + s.get(), room_key, pks.curve25519); + // TODO: Handle exception + cache::client()->saveOlmSession( + id_key, std::move(s)); + json body{ {"messages", {{user_id, -- cgit 1.5.1