summary refs log tree commit diff
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-06-18 12:29:24 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-06-18 12:29:24 +0300
commit4514d13948158ee8f6a7cb22bedd5b462802c2d1 (patch)
tree712358d30e69eacb346de28b641456b51b419701
parentMerge branch 'e2ee' (diff)
downloadnheko-4514d13948158ee8f6a7cb22bedd5b462802c2d1.tar.xz
Improve logging a bit
-rw-r--r--src/Olm.cpp6
-rw-r--r--src/timeline/TimelineView.cc5
2 files changed, 8 insertions, 3 deletions
diff --git a/src/Olm.cpp b/src/Olm.cpp
index 814fce18..5976c1c0 100644
--- a/src/Olm.cpp
+++ b/src/Olm.cpp
@@ -82,7 +82,8 @@ handle_pre_key_olm_message(const std::string &sender,
 
         OlmSessionPtr inbound_session = nullptr;
         try {
-                inbound_session = olm::client()->create_inbound_session(content.body);
+                inbound_session =
+                  olm::client()->create_inbound_session_from(sender_key, content.body);
 
                 // We also remove the one time key used to establish that
                 // session so we'll have to update our copy of the account object.
@@ -154,6 +155,9 @@ try_olm_decryption(const std::string &sender_key, const OlmCipherContent &msg)
 {
         auto session_ids = cache::client()->getOlmSessions(sender_key);
 
+        nhlog::crypto()->info("attempt to decrypt message with {} known session_ids",
+                              session_ids.size());
+
         for (const auto &id : session_ids) {
                 auto session = cache::client()->getOlmSession(sender_key, id);
 
diff --git a/src/timeline/TimelineView.cc b/src/timeline/TimelineView.cc
index e437439e..270e1d9a 100644
--- a/src/timeline/TimelineView.cc
+++ b/src/timeline/TimelineView.cc
@@ -331,7 +331,8 @@ TimelineView::parseEncryptedEvent(const mtx::events::EncryptedEvent<mtx::events:
         body["origin_server_ts"] = e.origin_server_ts;
         body["unsigned"]         = e.unsigned_data;
 
-        nhlog::crypto()->info("decrypted data: \n {}", body.dump(2));
+        nhlog::crypto()->info("decrypted event: {}", e.event_id);
+        nhlog::crypto()->debug("decrypted data: \n {}", body.dump(2));
 
         json event_array = json::array();
         event_array.push_back(body);
@@ -673,8 +674,8 @@ TimelineView::sendNextPendingMessage()
         nhlog::ui()->info("[{}] sending next queued message", m.txn_id);
 
         if (m.is_encrypted) {
-                prepareEncryptedMessage(std::move(m));
                 nhlog::ui()->info("[{}] sending encrypted event", m.txn_id);
+                prepareEncryptedMessage(std::move(m));
                 return;
         }