Bump ruma to e2728a70812412aade9322f6ad832731978a4240

master
Kévin Commaille 2021-04-11 12:04:53 +02:00
parent b5de203499
commit dadd2fa68c
No known key found for this signature in database
GPG Key ID: 483BCF4C5AF1E1E5
6 changed files with 18 additions and 10 deletions

View File

@ -646,11 +646,11 @@ impl Client {
if let Some(url) = self.avatar_url().await? { if let Some(url) = self.avatar_url().await? {
if let (Some(width), Some(height)) = (width, height) { if let (Some(width), Some(height)) = (width, height) {
let request = 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?; let response = self.send(request, None).await?;
Ok(Some(response.file)) Ok(Some(response.file))
} else { } else {
let request = get_content::Request::from_url(&url); let request = get_content::Request::from_url(&url)?;
let response = self.send(request, None).await?; let response = self.send(request, None).await?;
Ok(Some(response.file)) Ok(Some(response.file))
} }

View File

@ -21,6 +21,7 @@ use matrix_sdk_common::{
r0::uiaa::{UiaaInfo, UiaaResponse as UiaaError}, r0::uiaa::{UiaaInfo, UiaaResponse as UiaaError},
Error as RumaClientError, Error as RumaClientError,
}, },
identifiers::Error as IdentifierError,
FromHttpResponseError, IntoHttpError, ServerError, FromHttpResponseError, IntoHttpError, ServerError,
}; };
use reqwest::Error as ReqwestError; use reqwest::Error as ReqwestError;
@ -106,6 +107,10 @@ pub enum Error {
/// An error occured in the state store. /// An error occured in the state store.
#[error(transparent)] #[error(transparent)]
StateStore(#[from] StoreError), StateStore(#[from] StoreError),
/// An error encountered when trying to parse an invalid identifier string.
#[error(transparent)]
Identifier(#[from] IdentifierError),
} }
impl Error { impl Error {

View File

@ -97,11 +97,11 @@ impl Common {
if let Some(url) = self.avatar_url() { if let Some(url) = self.avatar_url() {
if let (Some(width), Some(height)) = (width, height) { if let (Some(width), Some(height)) = (width, height) {
let request = 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?; let response = self.client.send(request, None).await?;
Ok(Some(response.file)) Ok(Some(response.file))
} else { } 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?; let response = self.client.send(request, None).await?;
Ok(Some(response.file)) Ok(Some(response.file))
} }

View File

@ -66,11 +66,11 @@ impl RoomMember {
if let Some(url) = self.avatar_url() { if let Some(url) = self.avatar_url() {
if let (Some(width), Some(height)) = (width, height) { if let (Some(width), Some(height)) = (width, height) {
let request = 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?; let response = self.client.send(request, None).await?;
Ok(Some(response.file)) Ok(Some(response.file))
} else { } 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?; let response = self.client.send(request, None).await?;
Ok(Some(response.file)) Ok(Some(response.file))
} }

View File

@ -22,7 +22,7 @@ async-trait = "0.1.42"
[dependencies.ruma] [dependencies.ruma]
version = "0.0.2" version = "0.0.2"
git = "https://github.com/ruma/ruma" git = "https://github.com/ruma/ruma"
rev = "2f1b9f097930bf7908ca539f2ab7bb0ccf5d8b25" rev = "e2728a70812412aade9322f6ad832731978a4240"
features = ["client-api", "compat", "unstable-pre-spec"] features = ["client-api", "compat", "unstable-pre-spec"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]

View File

@ -13,7 +13,9 @@
// limitations under the License. // limitations under the License.
use matrix_sdk_common::{ use matrix_sdk_common::{
events::forwarded_room_key::ForwardedRoomKeyToDeviceEventContent, events::forwarded_room_key::{
ForwardedRoomKeyToDeviceEventContent, ForwardedRoomKeyToDeviceEventContentInit,
},
identifiers::{DeviceKeyAlgorithm, EventEncryptionAlgorithm, RoomId}, identifiers::{DeviceKeyAlgorithm, EventEncryptionAlgorithm, RoomId},
}; };
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
@ -87,7 +89,7 @@ impl TryInto<ForwardedRoomKeyToDeviceEventContent> for ExportedRoomKey {
return Err(()); return Err(());
} }
Ok(ForwardedRoomKeyToDeviceEventContent { Ok(ForwardedRoomKeyToDeviceEventContentInit {
algorithm: self.algorithm, algorithm: self.algorithm,
room_id: self.room_id, room_id: self.room_id,
sender_key: self.sender_key, sender_key: self.sender_key,
@ -95,7 +97,8 @@ impl TryInto<ForwardedRoomKeyToDeviceEventContent> for ExportedRoomKey {
session_key: self.session_key.0.clone(), session_key: self.session_key.0.clone(),
sender_claimed_ed25519_key: claimed_key.to_owned(), sender_claimed_ed25519_key: claimed_key.to_owned(),
forwarding_curve25519_key_chain: self.forwarding_curve25519_key_chain, forwarding_curve25519_key_chain: self.forwarding_curve25519_key_chain,
}) }
.into())
} }
} }
} }