Commit 84726b47 authored by Julian Sparber's avatar Julian Sparber
Browse files

bump matrix-sdk to e437aea01213338d7f11787411a025b6133efcff

This fixes the issue we are having caused by /profile api requiring
authentication.
parent 6b10fa3e
Pipeline #256327 passed with stages
in 41 minutes and 27 seconds
......@@ -215,6 +215,20 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]]
name = "backoff"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fe17f59a06fe8b87a6fc8bf53bb70b3aba76d7685f432487a68cd5552853625"
dependencies = [
"futures-core",
"getrandom 0.2.2",
"instant",
"pin-project 1.0.5",
"rand 0.8.3",
"tokio",
]
[[package]]
name = "base-x"
version = "0.2.8"
......@@ -1563,9 +1577,9 @@ checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47"
[[package]]
name = "hyper"
version = "0.14.2"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12219dc884514cb4a6a03737f4413c0e01c23a1b059b0156004b23f1e19dccbe"
checksum = "e8e946c2b1349055e0b72ae281b238baf1a3ea7307c7e9f9d64673bdd9c26ac7"
dependencies = [
"bytes",
"futures-channel",
......@@ -1600,9 +1614,9 @@ dependencies = [
[[package]]
name = "idna"
version = "0.2.0"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9"
checksum = "de910d521f7cc3135c4de8db1cb910e0b5ed1dc6f57c381cd07e8e661ce10094"
dependencies = [
"matches",
"unicode-bidi",
......@@ -1688,9 +1702,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
version = "0.2.85"
version = "0.2.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ccac4b00700875e6a07c6cde370d44d32fa01c5a65cdd2fca6858c479d28bb3"
checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c"
[[package]]
name = "libhandy"
......@@ -1857,8 +1871,9 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
[[package]]
name = "matrix-sdk"
version = "0.2.0"
source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=bdaed6237e104b738b5ad25c063675373d9fa60d#bdaed6237e104b738b5ad25c063675373d9fa60d"
source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=e437aea01213338d7f11787411a025b6133efcff#e437aea01213338d7f11787411a025b6133efcff"
dependencies = [
"backoff",
"dashmap",
"futures",
"futures-timer",
......@@ -1879,7 +1894,7 @@ dependencies = [
[[package]]
name = "matrix-sdk-base"
version = "0.2.0"
source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=bdaed6237e104b738b5ad25c063675373d9fa60d#bdaed6237e104b738b5ad25c063675373d9fa60d"
source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=e437aea01213338d7f11787411a025b6133efcff#e437aea01213338d7f11787411a025b6133efcff"
dependencies = [
"chacha20poly1305",
"dashmap",
......@@ -1902,7 +1917,7 @@ dependencies = [
[[package]]
name = "matrix-sdk-common"
version = "0.2.0"
source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=bdaed6237e104b738b5ad25c063675373d9fa60d#bdaed6237e104b738b5ad25c063675373d9fa60d"
source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=e437aea01213338d7f11787411a025b6133efcff#e437aea01213338d7f11787411a025b6133efcff"
dependencies = [
"async-trait",
"futures-locks",
......@@ -1916,7 +1931,7 @@ dependencies = [
[[package]]
name = "matrix-sdk-crypto"
version = "0.2.0"
source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=bdaed6237e104b738b5ad25c063675373d9fa60d#bdaed6237e104b738b5ad25c063675373d9fa60d"
source = "git+https://github.com/matrix-org/matrix-rust-sdk.git?rev=e437aea01213338d7f11787411a025b6133efcff#e437aea01213338d7f11787411a025b6133efcff"
dependencies = [
"aes-ctr",
"aes-gcm",
......@@ -2736,7 +2751,7 @@ dependencies = [
[[package]]
name = "ruma"
version = "0.0.2"
source = "git+https://github.com/ruma/ruma?rev=8c109d3c0a7ec66b352dc82677d30db7cb0723eb#8c109d3c0a7ec66b352dc82677d30db7cb0723eb"
source = "git+https://github.com/ruma/ruma?rev=d6aa37c848b7f682a98c25b346899e284ffc6df7#d6aa37c848b7f682a98c25b346899e284ffc6df7"
dependencies = [
"assign",
"js_int",
......@@ -2752,7 +2767,7 @@ dependencies = [
[[package]]
name = "ruma-api"
version = "0.17.0-alpha.2"
source = "git+https://github.com/ruma/ruma?rev=8c109d3c0a7ec66b352dc82677d30db7cb0723eb#8c109d3c0a7ec66b352dc82677d30db7cb0723eb"
source = "git+https://github.com/ruma/ruma?rev=d6aa37c848b7f682a98c25b346899e284ffc6df7#d6aa37c848b7f682a98c25b346899e284ffc6df7"
dependencies = [
"http",
"percent-encoding",
......@@ -2767,7 +2782,7 @@ dependencies = [
[[package]]
name = "ruma-api-macros"
version = "0.17.0-alpha.2"
source = "git+https://github.com/ruma/ruma?rev=8c109d3c0a7ec66b352dc82677d30db7cb0723eb#8c109d3c0a7ec66b352dc82677d30db7cb0723eb"
source = "git+https://github.com/ruma/ruma?rev=d6aa37c848b7f682a98c25b346899e284ffc6df7#d6aa37c848b7f682a98c25b346899e284ffc6df7"
dependencies = [
"proc-macro-crate",
"proc-macro2",
......@@ -2778,7 +2793,7 @@ dependencies = [
[[package]]
name = "ruma-client-api"
version = "0.10.0-alpha.2"
source = "git+https://github.com/ruma/ruma?rev=8c109d3c0a7ec66b352dc82677d30db7cb0723eb#8c109d3c0a7ec66b352dc82677d30db7cb0723eb"
source = "git+https://github.com/ruma/ruma?rev=d6aa37c848b7f682a98c25b346899e284ffc6df7#d6aa37c848b7f682a98c25b346899e284ffc6df7"
dependencies = [
"assign",
"http",
......@@ -2797,7 +2812,7 @@ dependencies = [
[[package]]
name = "ruma-common"
version = "0.3.0-alpha.1"
source = "git+https://github.com/ruma/ruma?rev=8c109d3c0a7ec66b352dc82677d30db7cb0723eb#8c109d3c0a7ec66b352dc82677d30db7cb0723eb"
source = "git+https://github.com/ruma/ruma?rev=d6aa37c848b7f682a98c25b346899e284ffc6df7#d6aa37c848b7f682a98c25b346899e284ffc6df7"
dependencies = [
"js_int",
"maplit",
......@@ -2810,7 +2825,7 @@ dependencies = [
[[package]]
name = "ruma-events"
version = "0.22.0-alpha.2"
source = "git+https://github.com/ruma/ruma?rev=8c109d3c0a7ec66b352dc82677d30db7cb0723eb#8c109d3c0a7ec66b352dc82677d30db7cb0723eb"
source = "git+https://github.com/ruma/ruma?rev=d6aa37c848b7f682a98c25b346899e284ffc6df7#d6aa37c848b7f682a98c25b346899e284ffc6df7"
dependencies = [
"js_int",
"ruma-common",
......@@ -2824,7 +2839,7 @@ dependencies = [
[[package]]
name = "ruma-events-macros"
version = "0.22.0-alpha.2"
source = "git+https://github.com/ruma/ruma?rev=8c109d3c0a7ec66b352dc82677d30db7cb0723eb#8c109d3c0a7ec66b352dc82677d30db7cb0723eb"
source = "git+https://github.com/ruma/ruma?rev=d6aa37c848b7f682a98c25b346899e284ffc6df7#d6aa37c848b7f682a98c25b346899e284ffc6df7"
dependencies = [
"proc-macro-crate",
"proc-macro2",
......@@ -2835,7 +2850,7 @@ dependencies = [
[[package]]
name = "ruma-federation-api"
version = "0.1.0-alpha.1"
source = "git+https://github.com/ruma/ruma?rev=8c109d3c0a7ec66b352dc82677d30db7cb0723eb#8c109d3c0a7ec66b352dc82677d30db7cb0723eb"
source = "git+https://github.com/ruma/ruma?rev=d6aa37c848b7f682a98c25b346899e284ffc6df7#d6aa37c848b7f682a98c25b346899e284ffc6df7"
dependencies = [
"js_int",
"ruma-api",
......@@ -2850,7 +2865,7 @@ dependencies = [
[[package]]
name = "ruma-identifiers"
version = "0.18.0-alpha.1"
source = "git+https://github.com/ruma/ruma?rev=8c109d3c0a7ec66b352dc82677d30db7cb0723eb#8c109d3c0a7ec66b352dc82677d30db7cb0723eb"
source = "git+https://github.com/ruma/ruma?rev=d6aa37c848b7f682a98c25b346899e284ffc6df7#d6aa37c848b7f682a98c25b346899e284ffc6df7"
dependencies = [
"paste",
"ruma-identifiers-macros",
......@@ -2863,7 +2878,7 @@ dependencies = [
[[package]]
name = "ruma-identifiers-macros"
version = "0.18.0-alpha.1"
source = "git+https://github.com/ruma/ruma?rev=8c109d3c0a7ec66b352dc82677d30db7cb0723eb#8c109d3c0a7ec66b352dc82677d30db7cb0723eb"
source = "git+https://github.com/ruma/ruma?rev=d6aa37c848b7f682a98c25b346899e284ffc6df7#d6aa37c848b7f682a98c25b346899e284ffc6df7"
dependencies = [
"proc-macro2",
"quote",
......@@ -2874,12 +2889,12 @@ dependencies = [
[[package]]
name = "ruma-identifiers-validation"
version = "0.2.0"
source = "git+https://github.com/ruma/ruma?rev=8c109d3c0a7ec66b352dc82677d30db7cb0723eb#8c109d3c0a7ec66b352dc82677d30db7cb0723eb"
source = "git+https://github.com/ruma/ruma?rev=d6aa37c848b7f682a98c25b346899e284ffc6df7#d6aa37c848b7f682a98c25b346899e284ffc6df7"
[[package]]
name = "ruma-serde"
version = "0.3.0"
source = "git+https://github.com/ruma/ruma?rev=8c109d3c0a7ec66b352dc82677d30db7cb0723eb#8c109d3c0a7ec66b352dc82677d30db7cb0723eb"
source = "git+https://github.com/ruma/ruma?rev=d6aa37c848b7f682a98c25b346899e284ffc6df7#d6aa37c848b7f682a98c25b346899e284ffc6df7"
dependencies = [
"form_urlencoded",
"itoa",
......@@ -2892,7 +2907,7 @@ dependencies = [
[[package]]
name = "ruma-serde-macros"
version = "0.3.0"
source = "git+https://github.com/ruma/ruma?rev=8c109d3c0a7ec66b352dc82677d30db7cb0723eb#8c109d3c0a7ec66b352dc82677d30db7cb0723eb"
source = "git+https://github.com/ruma/ruma?rev=d6aa37c848b7f682a98c25b346899e284ffc6df7#d6aa37c848b7f682a98c25b346899e284ffc6df7"
dependencies = [
"proc-macro-crate",
"proc-macro2",
......@@ -3035,9 +3050,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.61"
version = "1.0.62"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a"
checksum = "ea1c6153794552ea7cf7cf63b1231a25de00ec90db326ba6264440fa08e31486"
dependencies = [
"itoa",
"ryu",
......@@ -3186,9 +3201,9 @@ dependencies = [
[[package]]
name = "standback"
version = "0.2.14"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c66a8cff4fa24853fdf6b51f75c6d7f8206d7c75cab4e467bcd7f25c2b1febe0"
checksum = "a2beb4d1860a61f571530b3f855a1b538d0200f7871c63331ecd6f17b1f014f8"
dependencies = [
"version_check",
]
......@@ -3463,9 +3478,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
version = "1.1.1"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6714d663090b6b0acb0fa85841c6d66233d150cdb2602c8f9b8abb03370beb3f"
checksum = "e8190d04c665ea9e6b6a0dc45523ade572c088d2e6566244c1122671dbf4ae3a"
dependencies = [
"autocfg",
"bytes",
......@@ -3529,9 +3544,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6"
[[package]]
name = "tracing"
version = "0.1.22"
version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f47026cdc4080c07e49b37087de021820269d996f581aac150ef9e5583eefe3"
checksum = "f7d40a22fd029e33300d8d89a5cc8ffce18bb7c587662f54629e94c9de5487f3"
dependencies = [
"cfg-if 1.0.0",
"pin-project-lite",
......@@ -3620,9 +3635,9 @@ dependencies = [
[[package]]
name = "unicode-normalization"
version = "0.1.16"
version = "0.1.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a13e63ab62dbe32aeee58d1c5408d35c36c392bba5d9d3142287219721afe606"
checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef"
dependencies = [
"tinyvec",
]
......
......@@ -79,5 +79,5 @@ features = ["serde"]
[dependencies.matrix-sdk]
git = "https://github.com/matrix-org/matrix-rust-sdk.git"
rev = "bdaed6237e104b738b5ad25c063675373d9fa60d"
rev = "e437aea01213338d7f11787411a025b6133efcff"
features = ["unstable-synapse-quirks", "socks"]
......@@ -42,7 +42,7 @@ pub async fn protocols(
session_client: MatrixClient,
) -> Result<Vec<ProtocolInstance>, DirectoryProtocolsError> {
Ok(session_client
.send(GetProtocolsRequest::new())
.send(GetProtocolsRequest::new(), None)
.await?
.protocols
.into_iter()
......
......@@ -3,8 +3,7 @@ use log::error;
use matrix_sdk::identifiers::{EventId, RoomId, ServerName};
use matrix_sdk::{
api::{error::ErrorKind as RumaErrorKind, Error as RumaClientError},
Client as MatrixClient, Error as MatrixError, FromHttpResponseError as RumaResponseError,
ServerError,
Client as MatrixClient, Error as MatrixError, FromHttpResponseError, HttpError, ServerError,
};
use regex::Regex;
use std::convert::TryFrom;
......@@ -60,7 +59,7 @@ pub async fn get_prev_batch_from(
});
let prev_batch = session_client
.send(request)
.send(request, None)
.await?
.start
.unwrap_or_default();
......@@ -147,10 +146,10 @@ pub async fn dw_media(
method: Some(Method::Crop),
});
session_client.send(request).await?.file
session_client.send(request, None).await?.file
} else {
let request = GetContentRequest::new(&media_id, &server_name);
session_client.send(request).await?.file
session_client.send(request, None).await?.file
};
tokio::fs::write(&fname, media).await?;
......@@ -172,9 +171,9 @@ pub trait HandleError: Debug {
// Returns the encapsulated error in case it originated at the Matrix API level
pub(self) fn get_ruma_client_error(matrix_error: &MatrixError) -> Option<&RumaClientError> {
match matrix_error {
MatrixError::RumaResponse(RumaResponseError::Http(ServerError::Known(error))) => {
Some(error)
}
MatrixError::Http(HttpError::FromHttpResponse(FromHttpResponseError::Http(
ServerError::Known(error),
))) => Some(error),
_ => None,
}
}
......
......@@ -4,8 +4,7 @@ use serde_json::json;
use matrix_sdk::{
api::error::ErrorKind as RumaErrorKind,
identifiers::{EventId, RoomId, RoomIdOrAliasId, UserId},
Client as MatrixClient, Error as MatrixError, FromHttpResponseError as RumaResponseError,
ServerError,
Client as MatrixClient, Error as MatrixError, FromHttpResponseError, HttpError, ServerError,
};
use serde::Serialize;
use std::io::Error as IoError;
......@@ -109,7 +108,7 @@ pub async fn get_room_detail(
let request = GetStateEventForKeyRequest::new(&room_id, event_type.clone(), "");
let response = match session_client.send(request).await {
let response = match session_client.send(request, None).await {
Ok(response) => Some(response),
Err(err) if get_ruma_error_kind(&err) == Some(&RumaErrorKind::NotFound) => None,
Err(err) => return Err(err.into()),
......@@ -158,7 +157,7 @@ pub async fn get_room_avatar(
) -> Result<(RoomId, Option<Url>), RoomAvatarError> {
let request = GetStateEventForKeyRequest::new(&room_id, EventType::RoomAvatar, "");
let response = match session_client.send(request).await {
let response = match session_client.send(request, None).await {
Ok(response) => Some(response),
Err(err) if get_ruma_error_kind(&err) == Some(&RumaErrorKind::NotFound) => None,
Err(err) => return Err(err.into()),
......@@ -212,7 +211,7 @@ pub async fn get_room_members(
room_id: RoomId,
) -> Result<(RoomId, Vec<Member>), RoomMembersError> {
let request = JoinedMembersRequest::new(&room_id);
let response = session_client.send(request).await?;
let response = session_client.send(request, None).await?;
let ms = response
.joined
......@@ -413,7 +412,7 @@ pub async fn redact_msg(
let event_id = msg.id.ok_or(SendMsgRedactionError::MessageNotSent)?;
let request = RedactEventRequest::new(&msg.room, &event_id, txn_id);
let response = session_client.send(request).await?;
let response = session_client.send(request, None).await?;
Ok((event_id, response.event_id))
}
......@@ -430,9 +429,9 @@ impl From<MatrixError> for JoinRoomError {
impl HandleError for JoinRoomError {
fn handle_error(&self) {
let (err_str, info) = match &self.0 {
MatrixError::RumaResponse(RumaResponseError::Http(ServerError::Known(error))) => {
(error.message.clone(), Some(error.message.clone()))
}
MatrixError::Http(HttpError::FromHttpResponse(FromHttpResponseError::Http(
ServerError::Known(error),
))) => (error.message.clone(), Some(error.message.clone())),
error => (error.to_string(), None),
};
......@@ -527,7 +526,7 @@ pub async fn set_room_name(
let content = &AnyStateEventContent::RoomName(NameEventContent::new(name)?);
let request = SendStateEventForKeyRequest::new(room_id, "m.room.name", content);
session_client.send(request).await?;
session_client.send(request, None).await?;
Ok(())
}
......@@ -551,7 +550,7 @@ pub async fn set_room_topic(
let content = &AnyStateEventContent::RoomTopic(TopicEventContent { topic });
let request = SendStateEventForKeyRequest::new(room_id, "m.room.topic", content);
session_client.send(request).await?;
session_client.send(request, None).await?;
Ok(())
}
......@@ -593,7 +592,7 @@ pub async fn set_room_avatar(
url: Some(avatar_uri),
}));
let request = SendStateEventForKeyRequest::new(room_id, "m.room.avatar", content);
session_client.send(request).await?;
session_client.send(request, None).await?;
Ok(())
}
......@@ -646,7 +645,7 @@ pub async fn upload_file(
content_type: Some(&content_type),
});
session_client.send(request).await.map_err(Into::into)
session_client.send(request, None).await.map_err(Into::into)
}
#[derive(Debug, Clone, Copy)]
......@@ -740,7 +739,7 @@ async fn update_direct_chats(
let event_type = EventType::Direct;
let request = GetGlobalAccountDataRequest::new(user_id, event_type.as_ref());
let response = session_client.send(request).await?;
let response = session_client.send(request, None).await?;
let mut directs = match response
.account_data
......@@ -759,7 +758,7 @@ async fn update_direct_chats(
user_id,
);
session_client.send(request).await?;
session_client.send(request, None).await?;
Ok(())
}
......@@ -830,10 +829,10 @@ pub async fn add_to_fav(
order: Some(0.5),
}),
);
session_client.send(request).await?;
session_client.send(request, None).await?;
} else {
let request = DeleteTagRequest::new(user_id, room_id, tag);
session_client.send(request).await?;
session_client.send(request, None).await?;
}
Ok((rid, tofav))
......@@ -903,7 +902,7 @@ pub async fn set_language(
user_id,
);
session_client.send(request).await?;
session_client.send(request, None).await?;
Ok(())
}
......@@ -936,7 +935,7 @@ pub async fn get_pushrules(
) -> Result<RoomNotify, PushRulesError> {
let request = GetRoomRulesRequest::new("global", RuleKind::Room, room_id.as_str());
let value = match session_client.send(request).await {
let value = match session_client.send(request, None).await {
Ok(response) => {
response
.rule
......@@ -974,7 +973,7 @@ pub async fn set_pushrules(
let request = SetRoomRulesRequest::new("global", RuleKind::Room, room_id.as_str(), &actions);
session_client.send(request).await?;
session_client.send(request, None).await?;
Ok(())
}
......@@ -984,7 +983,7 @@ pub async fn delete_pushrules(
room_id: &RoomId,
) -> Result<(), PushRulesError> {
let request = DeleteRoomRulesRequest::new("global", RuleKind::Room, room_id.as_str());
session_client.send(request).await?;
session_client.send(request, None).await?;
Ok(())
}
......@@ -72,7 +72,7 @@ pub async fn get_username(
user_id: &UserId,
) -> Result<Option<String>, NameError> {
let request = GetDisplayNameRequest::new(user_id);
let response = session_client.send(request).await?;
let response = session_client.send(request, None).await?;
Ok(response.displayname)
}
......@@ -94,7 +94,7 @@ pub async fn set_username(
username: Option<String>,
) -> Result<Option<String>, SetUserNameError> {
let request = SetDisplayNameRequest::new(user_id, username.as_ref().map(String::as_str));
session_client.send(request).await?;
session_client.send(request, None).await?;
Ok(username)
}
......@@ -118,7 +118,7 @@ impl HandleError for GetThreePIDError {
pub async fn get_threepid(
session_client: MatrixClient,
) -> Result<Vec<ThirdPartyIdentifier>, GetThreePIDError> {
let response = session_client.send(GetContactsRequest::new()).await?;
let response = session_client.send(GetContactsRequest::new(), None).await?;
Ok(response.threepids)
}
......@@ -161,7 +161,7 @@ pub async fn get_email_token(
client_secret: String,
) -> Result<(String, String), GetTokenEmailError> {
let request = EmailTokenRequest::new(&client_secret, email, 1_u32.into());
let response = session_client.send(request).await?;
let response = session_client.send(request, None).await?;
Ok((response.sid, client_secret))
}
......@@ -206,7 +206,7 @@ pub async fn get_phone_token(
client_secret: String,
) -> Result<(String, String), GetTokenPhoneError> {
let request = PhoneTokenRequest::new(&client_secret, "", phone_number, 1_u32.into());
let response = session_client.send(request).await?;
let response = session_client.send(request, None).await?;
Ok((response.sid, client_secret))
}
......@@ -364,7 +364,7 @@ pub async fn change_password(
}),
});
session_client.send(request).await?;
session_client.send(request, None).await?;
Ok(())
}
......@@ -446,7 +446,7 @@ pub async fn set_user_avatar(
.content_uri;
let request = SetAvatarUrlRequest::new(user_id, Some(&avatar_url));
session_client.send(request).await?;
session_client.send(request, None).await?;
Ok(avatar)
}
......@@ -494,7 +494,7 @@ pub async fn search(
search_term: &str,
) -> Result<Vec<Member>, UserSearchError> {
let request = UserDirectoryRequest::new(search_term);
let response = session_client.send(request).await?;
let response = session_client.send(request, None).await?;
response
.results
......@@ -536,7 +536,7 @@ pub async fn get_user_avatar(
user_id: &UserId,
) -> Result<(String, PathBuf), GetUserAvatarError> {
let request = GetProfileRequest::new(user_id);
let response = session_client.send(request).await?;
let response = session_client.send(request, None).await?;
let img = match response
.avatar_url
......
......@@ -5,12 +5,13 @@ use async_trait::async_trait;
use gio::prelude::*;
use matrix_sdk::{
reqwest, Client as MatrixClient, ClientConfig as MatrixClientConfig, Error as MatrixSdkError,
HttpSend,
HttpError, HttpSend,
};
use url::Url;
use std::convert::TryInto;
use std::sync::{Arc, Mutex};
use std::time::Duration;
// Special URI used by gio to indicate no proxy
const PROXY_DIRECT_URI: &str = "direct://";
......@@ -132,8 +133,9 @@ impl HttpSend for Client {
async fn send_request(
&self,
req: http::Request<Vec<u8>>,
) -> matrix_sdk::Result<http::Response<Vec<u8>>> {
self.get_client().send_request(req).await
duration: Option<Duration>,
) -> Result<http::Response<Vec<u8>>, HttpError> {
self.get_client().send_request(req, duration).await
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment