client: Add a method to get the ed25519 key of our own device

master
Damir Jelić 2021-05-06 21:44:50 +02:00
parent 43b7072609
commit 8dbbacfbe6
1 changed files with 11 additions and 0 deletions

View File

@ -543,6 +543,17 @@ impl Client {
session.as_ref().map(|s| s.device_id.clone()) session.as_ref().map(|s| s.device_id.clone())
} }
/// Get the public ed25519 key of our own device. This is usually what is
/// called the fingerprint of the device.
#[cfg(feature = "encryption")]
#[cfg_attr(feature = "docs", doc(cfg(encryption)))]
pub async fn ed25519_key(&self) -> Option<String> {
self.base_client
.olm_machine()
.await
.map(|o| o.identity_keys().ed25519().to_owned())
}
/// Fetches the display name of the owner of the client. /// Fetches the display name of the owner of the client.
/// ///
/// # Example /// # Example