From 2a09e588f3fd0bfea83d269560276feb7b576677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 17 Feb 2021 16:01:51 +0100 Subject: [PATCH] crypto: Log when we receive room keys --- matrix_sdk_crypto/src/key_request.rs | 9 +++++++++ matrix_sdk_crypto/src/machine.rs | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/matrix_sdk_crypto/src/key_request.rs b/matrix_sdk_crypto/src/key_request.rs index c2be3528..c77b8af9 100644 --- a/matrix_sdk_crypto/src/key_request.rs +++ b/matrix_sdk_crypto/src/key_request.rs @@ -664,6 +664,15 @@ impl KeyRequestMachine { Some(session) }; + if let Some(s) = &session { + info!( + "Received a forwarded room key from {} for room {} with session id {}", + event.sender, + s.room_id(), + s.session_id() + ); + } + Ok(( Some(AnyToDeviceEvent::ForwardedRoomKey(event.clone())), session, diff --git a/matrix_sdk_crypto/src/machine.rs b/matrix_sdk_crypto/src/machine.rs index c580f745..dca6603b 100644 --- a/matrix_sdk_crypto/src/machine.rs +++ b/matrix_sdk_crypto/src/machine.rs @@ -598,6 +598,13 @@ impl OlmMachine { &event.content.room_id, session_key, )?; + + info!( + "Received a new room key from {} for room {} with session id {}", + event.sender, + event.content.room_id, + session.session_id() + ); let event = AnyToDeviceEvent::RoomKey(event.clone()); Ok((Some(event), Some(session))) }