client: Add an accessor method for the device id

master
Damir Jelić 2021-01-23 15:59:53 +01:00
parent 077050efb4
commit 44974982e1
1 changed files with 6 additions and 0 deletions

View File

@ -425,6 +425,12 @@ impl Client {
session.as_ref().cloned().map(|s| s.user_id) session.as_ref().cloned().map(|s| s.user_id)
} }
/// Get the device id that identifies the current session.
pub async fn device_id(&self) -> Option<DeviceIdBox> {
let session = self.base_client.session().read().await;
session.as_ref().map(|s| s.device_id.clone())
}
/// Fetches the display name of the owner of the client. /// Fetches the display name of the owner of the client.
/// ///
/// # Example /// # Example