From 2b5d2e97c076599593f7220495a9598705a3d8be Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 13 Jun 2024 17:32:05 +0100 Subject: [PATCH] sdk: add documentation on `Backups::utd_event_handler` --- crates/matrix-sdk/src/encryption/backups/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/matrix-sdk/src/encryption/backups/mod.rs b/crates/matrix-sdk/src/encryption/backups/mod.rs index ee78a2023..99589e5bf 100644 --- a/crates/matrix-sdk/src/encryption/backups/mod.rs +++ b/crates/matrix-sdk/src/encryption/backups/mod.rs @@ -878,6 +878,13 @@ impl Backups { } } + /// Handle UTD events by triggering download from key backup. + /// + /// This function is registered as an event handler; it exists to deal + /// with cases where [`Room::decrypt_event`] is not called and instead the + /// event should be decrypted by the time this crate sees the event, such as + /// for events received via `/sync` (as opposed to via `/messages`, + /// `/context`, etc.) #[allow(clippy::unused_async)] // Because it's used as an event handler, which must be async. pub(crate) async fn utd_event_handler( event: SyncRoomEncryptedEvent,