crypto: Rename the UserDevicesWrap struct.

master
Damir Jelić 2020-08-17 17:12:39 +02:00
parent de097d3ca0
commit 84c0311d80
6 changed files with 11 additions and 11 deletions

View File

@ -14,7 +14,7 @@
use std::ops::Deref;
use matrix_sdk_base::{Device as BaseDevice, ReadOnlyDevice, UserDevicesWrap};
use matrix_sdk_base::{Device as BaseDevice, ReadOnlyDevice, UserDevices as BaseUserDevices};
use matrix_sdk_common::{
api::r0::to_device::send_event_to_device::Request as ToDeviceRequest, identifiers::DeviceId,
};
@ -77,7 +77,7 @@ impl Device {
/// A read only view over all devices belonging to a user.
#[derive(Debug)]
pub struct UserDevices {
pub(crate) inner: UserDevicesWrap,
pub(crate) inner: BaseUserDevices,
pub(crate) http_client: HttpClient,
}

View File

@ -53,7 +53,7 @@ use matrix_sdk_common::{
};
#[cfg(feature = "encryption")]
use matrix_sdk_crypto::{
CryptoStore, CryptoStoreError, Device, OlmError, OlmMachine, Sas, UserDevicesWrap,
CryptoStore, CryptoStoreError, Device, OlmError, OlmMachine, Sas, UserDevices,
};
use zeroize::Zeroizing;
@ -1945,7 +1945,7 @@ impl BaseClient {
pub async fn get_user_devices(
&self,
user_id: &UserId,
) -> StdResult<UserDevicesWrap, CryptoStoreError> {
) -> StdResult<UserDevices, CryptoStoreError> {
let olm = self.olm.lock().await;
if let Some(olm) = olm.as_ref() {

View File

@ -57,7 +57,7 @@ pub use state::{AllRooms, ClientState};
#[cfg(feature = "encryption")]
#[cfg_attr(feature = "docs", doc(cfg(encryption)))]
pub use matrix_sdk_crypto::{
CryptoStoreError, Device, ReadOnlyDevice, Sas, TrustState, UserDevicesWrap,
CryptoStoreError, Device, ReadOnlyDevice, Sas, TrustState, UserDevices,
};
#[cfg(feature = "messages")]

View File

@ -78,12 +78,12 @@ impl Device {
/// A read only view over all devices belonging to a user.
#[derive(Debug)]
pub struct UserDevicesWrap {
pub struct UserDevices {
pub(crate) inner: ReadOnlyUserDevices,
pub(crate) verification_machine: VerificationMachine,
}
impl UserDevicesWrap {
impl UserDevices {
/// Get the specific device with the given device id.
pub fn get(&self, device_id: &DeviceId) -> Option<Device> {
self.inner.get(device_id).map(|d| Device {

View File

@ -37,7 +37,7 @@ mod store;
mod user_identity;
mod verification;
pub use device::{Device, ReadOnlyDevice, TrustState, UserDevicesWrap};
pub use device::{Device, ReadOnlyDevice, TrustState, UserDevices};
pub use error::{MegolmError, OlmError};
pub use machine::{OlmMachine, OneTimeKeys};
pub use memory_stores::{DeviceStore, GroupSessionStore, ReadOnlyUserDevices, SessionStore};

View File

@ -53,7 +53,7 @@ use matrix_sdk_common::{
#[cfg(feature = "sqlite_cryptostore")]
use super::store::sqlite::SqliteStore;
use super::{
device::{Device, ReadOnlyDevice, UserDevicesWrap},
device::{Device, ReadOnlyDevice, UserDevices},
error::{EventError, MegolmError, MegolmResult, OlmError, OlmResult},
olm::{
Account, EncryptionSettings, GroupSessionKey, IdentityKeys, InboundGroupSession,
@ -1367,10 +1367,10 @@ impl OlmMachine {
/// }
/// # });
/// ```
pub async fn get_user_devices(&self, user_id: &UserId) -> StoreResult<UserDevicesWrap> {
pub async fn get_user_devices(&self, user_id: &UserId) -> StoreResult<UserDevices> {
let devices = self.store.get_user_devices(user_id).await?;
Ok(UserDevicesWrap {
Ok(UserDevices {
inner: devices,
verification_machine: self.verification_machine.clone(),
})