diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs index 3f4244ca..1416a533 100644 --- a/matrix_sdk/src/client.rs +++ b/matrix_sdk/src/client.rs @@ -646,11 +646,11 @@ impl Client { if let Some(url) = self.avatar_url().await? { if let (Some(width), Some(height)) = (width, height) { let request = - get_content_thumbnail::Request::from_url(&url, width.into(), height.into()); + get_content_thumbnail::Request::from_url(&url, width.into(), height.into())?; let response = self.send(request, None).await?; Ok(Some(response.file)) } else { - let request = get_content::Request::from_url(&url); + let request = get_content::Request::from_url(&url)?; let response = self.send(request, None).await?; Ok(Some(response.file)) } diff --git a/matrix_sdk/src/error.rs b/matrix_sdk/src/error.rs index 1b0fc1bf..86fcf899 100644 --- a/matrix_sdk/src/error.rs +++ b/matrix_sdk/src/error.rs @@ -21,6 +21,7 @@ use matrix_sdk_common::{ r0::uiaa::{UiaaInfo, UiaaResponse as UiaaError}, Error as RumaClientError, }, + identifiers::Error as IdentifierError, FromHttpResponseError, IntoHttpError, ServerError, }; use reqwest::Error as ReqwestError; @@ -106,6 +107,10 @@ pub enum Error { /// An error occured in the state store. #[error(transparent)] StateStore(#[from] StoreError), + + /// An error encountered when trying to parse an invalid identifier string. + #[error(transparent)] + Identifier(#[from] IdentifierError), } impl Error { diff --git a/matrix_sdk/src/room/common.rs b/matrix_sdk/src/room/common.rs index 0183a7e4..de330f29 100644 --- a/matrix_sdk/src/room/common.rs +++ b/matrix_sdk/src/room/common.rs @@ -97,11 +97,11 @@ impl Common { if let Some(url) = self.avatar_url() { if let (Some(width), Some(height)) = (width, height) { let request = - get_content_thumbnail::Request::from_url(&url, width.into(), height.into()); + get_content_thumbnail::Request::from_url(&url, width.into(), height.into())?; let response = self.client.send(request, None).await?; Ok(Some(response.file)) } else { - let request = get_content::Request::from_url(&url); + let request = get_content::Request::from_url(&url)?; let response = self.client.send(request, None).await?; Ok(Some(response.file)) } diff --git a/matrix_sdk/src/room_member.rs b/matrix_sdk/src/room_member.rs index ab408abf..81c66fce 100644 --- a/matrix_sdk/src/room_member.rs +++ b/matrix_sdk/src/room_member.rs @@ -66,11 +66,11 @@ impl RoomMember { if let Some(url) = self.avatar_url() { if let (Some(width), Some(height)) = (width, height) { let request = - get_content_thumbnail::Request::from_url(&url, width.into(), height.into()); + get_content_thumbnail::Request::from_url(&url, width.into(), height.into())?; let response = self.client.send(request, None).await?; Ok(Some(response.file)) } else { - let request = get_content::Request::from_url(url); + let request = get_content::Request::from_url(url)?; let response = self.client.send(request, None).await?; Ok(Some(response.file)) } diff --git a/matrix_sdk_common/Cargo.toml b/matrix_sdk_common/Cargo.toml index 4b763a88..5c89b13b 100644 --- a/matrix_sdk_common/Cargo.toml +++ b/matrix_sdk_common/Cargo.toml @@ -22,7 +22,7 @@ async-trait = "0.1.42" [dependencies.ruma] version = "0.0.2" git = "https://github.com/ruma/ruma" -rev = "2f1b9f097930bf7908ca539f2ab7bb0ccf5d8b25" +rev = "e2728a70812412aade9322f6ad832731978a4240" features = ["client-api", "compat", "unstable-pre-spec"] [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/matrix_sdk_crypto/src/olm/group_sessions/mod.rs b/matrix_sdk_crypto/src/olm/group_sessions/mod.rs index 0f833447..720ab997 100644 --- a/matrix_sdk_crypto/src/olm/group_sessions/mod.rs +++ b/matrix_sdk_crypto/src/olm/group_sessions/mod.rs @@ -13,7 +13,9 @@ // limitations under the License. use matrix_sdk_common::{ - events::forwarded_room_key::ForwardedRoomKeyToDeviceEventContent, + events::forwarded_room_key::{ + ForwardedRoomKeyToDeviceEventContent, ForwardedRoomKeyToDeviceEventContentInit, + }, identifiers::{DeviceKeyAlgorithm, EventEncryptionAlgorithm, RoomId}, }; use serde::{Deserialize, Serialize}; @@ -87,7 +89,7 @@ impl TryInto for ExportedRoomKey { return Err(()); } - Ok(ForwardedRoomKeyToDeviceEventContent { + Ok(ForwardedRoomKeyToDeviceEventContentInit { algorithm: self.algorithm, room_id: self.room_id, sender_key: self.sender_key, @@ -95,7 +97,8 @@ impl TryInto for ExportedRoomKey { session_key: self.session_key.0.clone(), sender_claimed_ed25519_key: claimed_key.to_owned(), forwarding_curve25519_key_chain: self.forwarding_curve25519_key_chain, - }) + } + .into()) } } }