From 008a33d7b85acb946c9fd612ef63b920abc64690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Mon, 27 May 2024 13:32:27 +0200 Subject: [PATCH] fixup! Add a method to ensure device keys are uploaded --- crates/matrix-sdk/src/encryption/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/matrix-sdk/src/encryption/mod.rs b/crates/matrix-sdk/src/encryption/mod.rs index d7db4d095e3..234d9c0d4a3 100644 --- a/crates/matrix-sdk/src/encryption/mod.rs +++ b/crates/matrix-sdk/src/encryption/mod.rs @@ -1407,6 +1407,15 @@ impl Encryption { } } + /// Upload the device keys and initial set of one-tim keys to the server. + /// + /// This should only be called when the user logs in for the first time, + /// the method will ensure that other devices see our own device as an + /// end-to-end encryption enabled one. + /// + /// **Warning**: Do not use this method if we're already calling + /// [`Client::send_outgoing_request()`]. This method is intended for + /// explicitly uploading the device keys before starting a sync. #[cfg(feature = "experimental-oidc")] pub(crate) async fn ensure_device_keys_upload(&self) -> Result<()> { let olm = self.client.olm_machine().await;