summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-06-15 01:35:31 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-06-15 01:35:31 +0300
commit9102a141f3f169c39b4fe87839e646eb68fd4b55 (patch)
tree8e1edb2f73544c428e3c20a6402f801134a302d1 /src/timeline
parentFix CI errors on macOS & Windows (diff)
downloadnheko-9102a141f3f169c39b4fe87839e646eb68fd4b55.tar.xz
Handle OLM_MESSAGE type of messages properly
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/TimelineView.cc13
1 files changed, 8 insertions, 5 deletions
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,