diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs index 97e7a00f..b2dad9ce 100644 --- a/matrix_sdk/src/client.rs +++ b/matrix_sdk/src/client.rs @@ -1254,8 +1254,6 @@ impl Client { } }; - // TODO send out to-device messages here - #[cfg(feature = "encryption")] { if self.base_client.should_upload_keys().await { @@ -1273,6 +1271,16 @@ impl Client { warn!("Error while querying device keys {:?}", e); } } + + for request in self.base_client.outgoing_to_device_requests().await { + let transaction_id = request.txn_id.clone(); + + if let Ok(_) = self.send(request).await { + self.base_client + .mark_to_device_request_as_sent(&transaction_id) + .await; + } + } } callback(response).await;