diff --git a/libsignal-service/src/sender.rs b/libsignal-service/src/sender.rs index f0c8fcfd7..86315742a 100644 --- a/libsignal-service/src/sender.rs +++ b/libsignal-service/src/sender.rs @@ -752,6 +752,25 @@ where Ok(()) } + /// Send `Keys` synchronization message + #[tracing::instrument(skip(self))] + pub async fn send_keys( + &mut self, + recipient: &ServiceAddress, + keys: sync_message::Keys, + ) -> Result<(), MessageSenderError> { + let msg = SyncMessage { + keys: Some(keys), + ..SyncMessage::with_padding() + }; + + let ts = Utc::now().timestamp_millis() as u64; + self.send_message(recipient, None, msg, ts, false, false) + .await?; + + Ok(()) + } + #[tracing::instrument(level = "trace", skip(self))] fn create_pni_signature( &mut self,