Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ rand = { version = "0.10.0", default-features = false, features = ["std", "std_r
regex = { version = "1.12.2", default-features = false }
reqwest = { version = "0.13.1", default-features = false }
rmp-serde = { version = "1.3.0", default-features = false }
ruma = { git = "https://github.com/ruma/ruma", rev = "a0acf4187a7c7557d145db54bcb23b01f6295ce7", features = [
ruma = { git = "https://github.com/ruma/ruma", rev = "7680eebd9586669e1a4e5b1fd1c2c691221369d4", features = [
"client-api-c",
"compat-unset-avatar",
"compat-upload-signatures",
Expand Down
4 changes: 4 additions & 0 deletions bindings/matrix-sdk-ffi/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ All notable changes to this project will be documented in this file.

### Refactor

- [**breaking**] The `RoomAliases` variants of `StateEventContent`, `StateEventType` and
`OtherState` was removed. This state event type was removed from the Matrix specification a while
ago, and support for it has been removed in Ruma.
([#6414](https://github.com/matrix-org/matrix-rust-sdk/pull/6414))
- `Client::new` no longer unnecessarily instantiates an `OAuth` component if `CrossProcessLockConfig::SingleProcess`
is used. ([#6293](https://github.com/matrix-org/matrix-rust-sdk/pull/6293))
- [**breaking**] `Room::report_content()` no longer takes a `score` argument, because it was
Expand Down
16 changes: 9 additions & 7 deletions bindings/matrix-sdk-ffi/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,17 @@ use matrix_sdk_ui::{
use mime::Mime;
use oauth2::Scope;
use ruma::{
api::client::{
alias::get_alias,
discovery::get_authorization_server_metadata::v1::{
AccountManagementActionData, DeviceDeleteData, DeviceViewData,
api::{
client::{
alias::get_alias,
discovery::get_authorization_server_metadata::v1::{
AccountManagementActionData, DeviceDeleteData, DeviceViewData,
},
profile::{AvatarUrl, DisplayName},
room::create_room::{v3::CreationContent, RoomPowerLevelsContentOverride},
uiaa::{EmailUserIdentifier, UserIdentifier},
},
error::ErrorKind,
profile::{AvatarUrl, DisplayName},
room::create_room::{v3::CreationContent, RoomPowerLevelsContentOverride},
uiaa::{EmailUserIdentifier, UserIdentifier},
},
events::{
direct::DirectEventContent,
Expand Down
2 changes: 1 addition & 1 deletion bindings/matrix-sdk-ffi/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use matrix_sdk::{
};
use matrix_sdk_ui::{encryption_sync_service, notification_client, spaces, sync_service, timeline};
use ruma::{
api::client::error::{ErrorBody, ErrorKind as RumaApiErrorKind, RetryAfter, StandardErrorBody},
api::error::{ErrorBody, ErrorKind as RumaApiErrorKind, RetryAfter, StandardErrorBody},
MilliSecondsSinceUnixEpoch,
};
use tracing::warn;
Expand Down
7 changes: 0 additions & 7 deletions bindings/matrix-sdk-ffi/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,6 @@ impl From<RumaTimelineEventType> for TimelineEventType {
RumaTimelineEventType::PolicyRuleUser => {
Self::State { value: StateEventType::PolicyRuleUser }
}
RumaTimelineEventType::RoomAliases => {
Self::State { value: StateEventType::RoomAliases }
}
RumaTimelineEventType::RoomAvatar => Self::State { value: StateEventType::RoomAvatar },
RumaTimelineEventType::RoomCanonicalAlias => {
Self::State { value: StateEventType::RoomCanonicalAlias }
Expand Down Expand Up @@ -306,7 +303,6 @@ pub enum StateEventContent {
PolicyRuleRoom,
PolicyRuleServer,
PolicyRuleUser,
RoomAliases,
RoomAvatar,
RoomCanonicalAlias,
RoomCreate,
Expand Down Expand Up @@ -334,7 +330,6 @@ impl TryFrom<AnySyncStateEvent> for StateEventContent {
AnySyncStateEvent::PolicyRuleRoom(_) => StateEventContent::PolicyRuleRoom,
AnySyncStateEvent::PolicyRuleServer(_) => StateEventContent::PolicyRuleServer,
AnySyncStateEvent::PolicyRuleUser(_) => StateEventContent::PolicyRuleUser,
AnySyncStateEvent::RoomAliases(_) => StateEventContent::RoomAliases,
AnySyncStateEvent::RoomAvatar(_) => StateEventContent::RoomAvatar,
AnySyncStateEvent::RoomCanonicalAlias(_) => StateEventContent::RoomCanonicalAlias,
AnySyncStateEvent::RoomCreate(_) => StateEventContent::RoomCreate,
Expand Down Expand Up @@ -526,7 +521,6 @@ pub enum StateEventType {
PolicyRuleRoom,
PolicyRuleServer,
PolicyRuleUser,
RoomAliases,
RoomAvatar,
RoomCanonicalAlias,
RoomCreate,
Expand Down Expand Up @@ -558,7 +552,6 @@ impl From<StateEventType> for ruma::events::StateEventType {
StateEventType::PolicyRuleRoom => Self::PolicyRuleRoom,
StateEventType::PolicyRuleServer => Self::PolicyRuleServer,
StateEventType::PolicyRuleUser => Self::PolicyRuleUser,
StateEventType::RoomAliases => Self::RoomAliases,
StateEventType::RoomAvatar => Self::RoomAvatar,
StateEventType::RoomCanonicalAlias => Self::RoomCanonicalAlias,
StateEventType::RoomCreate => Self::RoomCreate,
Expand Down
2 changes: 0 additions & 2 deletions bindings/matrix-sdk-ffi/src/timeline/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ pub enum OtherState {
PolicyRuleRoom,
PolicyRuleServer,
PolicyRuleUser,
RoomAliases,
RoomAvatar {
url: Option<String>,
},
Expand Down Expand Up @@ -363,7 +362,6 @@ impl From<&matrix_sdk_ui::timeline::AnyOtherStateEventContentChange> for OtherSt
Content::PolicyRuleRoom(_) => Self::PolicyRuleRoom,
Content::PolicyRuleServer(_) => Self::PolicyRuleServer,
Content::PolicyRuleUser(_) => Self::PolicyRuleUser,
Content::RoomAliases(_) => Self::RoomAliases,
Content::RoomAvatar(c) => {
let url = match c {
FullContent::Original { content, .. } => {
Expand Down
3 changes: 3 additions & 0 deletions crates/matrix-sdk-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ All notable changes to this project will be documented in this file.

### Refactor

- [**breaking**] `AnyOtherStateEventContentChange::RoomAliases` was removed. This state event type
was removed from the Matrix specification a while ago, and support for it has been removed in Ruma.
([#6414](https://github.com/matrix-org/matrix-rust-sdk/pull/6414))
- [**breaking**] Move `LiveLocation` out of `TimelineItemContent` and into `MsgLikeKind`
so it has access to `MsgLikeContent` `reactions`.
([#6286](https://github.com/matrix-org/matrix-rust-sdk/pull/6286))
Expand Down
3 changes: 1 addition & 2 deletions crates/matrix-sdk-ui/src/sync_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,7 @@ impl TerminationReport {
match &self.error {
Some(Error::RoomList(room_list_service::Error::SlidingSync(error)))
| Some(Error::EncryptionSync(encryption_sync_service::Error::SlidingSync(error))) => {
error.client_api_error_kind()
== Some(&ruma::api::client::error::ErrorKind::UnknownPos)
error.client_api_error_kind() == Some(&ruma::api::error::ErrorKind::UnknownPos)
}
_ => false,
}
Expand Down
9 changes: 0 additions & 9 deletions crates/matrix-sdk-ui/src/timeline/event_item/content/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ use ruma::{
},
relation::Replacement,
room::{
aliases::RoomAliasesEventContent,
avatar::RoomAvatarEventContent,
canonical_alias::RoomCanonicalAliasEventContent,
create::RoomCreateEventContent,
Expand Down Expand Up @@ -725,9 +724,6 @@ pub enum AnyOtherStateEventContentChange {
/// m.policy.rule.user
PolicyRuleUser(StateEventContentChange<PolicyRuleUserEventContent>),

/// m.room.aliases
RoomAliases(StateEventContentChange<RoomAliasesEventContent>),

/// m.room.avatar
RoomAvatar(StateEventContentChange<RoomAvatarEventContent>),

Expand Down Expand Up @@ -793,7 +789,6 @@ impl AnyOtherStateEventContentChange {
AnyStateEventContentChange::PolicyRuleRoom(c) => Self::PolicyRuleRoom(c),
AnyStateEventContentChange::PolicyRuleServer(c) => Self::PolicyRuleServer(c),
AnyStateEventContentChange::PolicyRuleUser(c) => Self::PolicyRuleUser(c),
AnyStateEventContentChange::RoomAliases(c) => Self::RoomAliases(c),
AnyStateEventContentChange::RoomAvatar(c) => Self::RoomAvatar(c),
AnyStateEventContentChange::RoomCanonicalAlias(c) => Self::RoomCanonicalAlias(c),
AnyStateEventContentChange::RoomCreate(c) => Self::RoomCreate(c),
Expand Down Expand Up @@ -821,7 +816,6 @@ impl AnyOtherStateEventContentChange {
Self::PolicyRuleRoom(c) => c.event_type(),
Self::PolicyRuleServer(c) => c.event_type(),
Self::PolicyRuleUser(c) => c.event_type(),
Self::RoomAliases(c) => c.event_type(),
Self::RoomAvatar(c) => c.event_type(),
Self::RoomCanonicalAlias(c) => c.event_type(),
Self::RoomCreate(c) => c.event_type(),
Expand Down Expand Up @@ -853,9 +847,6 @@ impl AnyOtherStateEventContentChange {
Self::PolicyRuleUser(c) => {
Self::PolicyRuleUser(StateEventContentChange::Redacted(c.clone().redact(rules)))
}
Self::RoomAliases(c) => {
Self::RoomAliases(StateEventContentChange::Redacted(c.clone().redact(rules)))
}
Self::RoomAvatar(c) => {
Self::RoomAvatar(StateEventContentChange::Redacted(c.clone().redact(rules)))
}
Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk-ui/tests/integration/timeline/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ async fn test_reloaded_failed_local_echoes_are_marked_as_failed() {
// And it's properly pattern-matched as an HTTP error.
assert_matches!(
error.as_client_api_error().unwrap().error_kind(),
Some(ruma::api::client::error::ErrorKind::TooLarge)
Some(ruma::api::error::ErrorKind::TooLarge)
);

assert_pending!(timeline_stream);
Expand Down
16 changes: 8 additions & 8 deletions crates/matrix-sdk/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ use ruma::{
request_3pid_management_token_via_email, request_3pid_management_token_via_msisdn,
},
config::{get_global_account_data, set_global_account_data},
error::ErrorKind,
profile::{
DisplayName, StaticProfileField, delete_profile_field, get_avatar_url, get_profile,
get_profile_field, set_avatar_url, set_display_name, set_profile_field,
},
uiaa::AuthData,
},
error::ErrorKind,
},
assign,
events::{
Expand Down Expand Up @@ -379,7 +379,7 @@ impl Account {
/// response, which would result in `Ok(None)`. Note that this error code
/// might also mean that the given user ID doesn't exist.
///
/// [`ErrorCode::NotFound`]: ruma::api::client::error::ErrorCode::NotFound
/// [`ErrorCode::NotFound`]: ruma::api::error::ErrorCode::NotFound
pub async fn fetch_profile_field_of(
&self,
user_id: OwnedUserId,
Expand Down Expand Up @@ -411,7 +411,7 @@ impl Account {
/// response, which would result in `Ok(None)`. Note that this error code
/// might also mean that the given user ID doesn't exist.
///
/// [`ErrorCode::NotFound`]: ruma::api::client::error::ErrorCode::NotFound
/// [`ErrorCode::NotFound`]: ruma::api::error::ErrorCode::NotFound
pub async fn fetch_profile_field_of_static<F>(
&self,
user_id: OwnedUserId,
Expand Down Expand Up @@ -517,7 +517,7 @@ impl Account {
/// ```
/// [uiaa]: https://spec.matrix.org/v1.2/client-server-api/#user-interactive-authentication-api
/// [`UiaaResponse`]: ruma::api::client::uiaa::UiaaResponse
/// [`ErrorKind::WeakPassword`]: ruma::api::client::error::ErrorKind::WeakPassword
/// [`ErrorKind::WeakPassword`]: ruma::api::error::ErrorKind::WeakPassword
pub async fn change_password(
&self,
new_password: &str,
Expand Down Expand Up @@ -668,8 +668,8 @@ impl Account {
/// # anyhow::Ok(()) };
/// ```
/// [3pid]: https://spec.matrix.org/v1.2/appendices/#3pid-types
/// [`ErrorKind::ThreepidInUse`]: ruma::api::client::error::ErrorKind::ThreepidInUse
/// [`ErrorKind::ThreepidDenied`]: ruma::api::client::error::ErrorKind::ThreepidDenied
/// [`ErrorKind::ThreepidInUse`]: ruma::api::error::ErrorKind::ThreepidInUse
/// [`ErrorKind::ThreepidDenied`]: ruma::api::error::ErrorKind::ThreepidDenied
pub async fn request_3pid_email_token(
&self,
client_secret: &ClientSecret,
Expand Down Expand Up @@ -743,8 +743,8 @@ impl Account {
/// # anyhow::Ok(()) };
/// ```
/// [3pid]: https://spec.matrix.org/v1.2/appendices/#3pid-types
/// [`ErrorKind::ThreepidInUse`]: ruma::api::client::error::ErrorKind::ThreepidInUse
/// [`ErrorKind::ThreepidDenied`]: ruma::api::client::error::ErrorKind::ThreepidDenied
/// [`ErrorKind::ThreepidInUse`]: ruma::api::error::ErrorKind::ThreepidInUse
/// [`ErrorKind::ThreepidDenied`]: ruma::api::error::ErrorKind::ThreepidDenied
pub async fn request_3pid_msisdn_token(
&self,
client_secret: &ClientSecret,
Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk/src/authentication/matrix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ impl MatrixAuth {
/// ```
///
/// [refreshing access tokens]: https://spec.matrix.org/v1.3/client-server-api/#refreshing-access-tokens
/// [`UnknownToken`]: ruma::api::client::error::ErrorKind::UnknownToken
/// [`UnknownToken`]: ruma::api::error::ErrorKind::UnknownToken
/// [restore the session]: Client::restore_session
/// [`ClientBuilder::handle_refresh_tokens()`]: crate::ClientBuilder::handle_refresh_tokens
pub async fn refresh_access_token(&self) -> Result<(), RefreshTokenError> {
Expand Down
4 changes: 2 additions & 2 deletions crates/matrix-sdk/src/authentication/oauth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@
//! [MSC4108]: https://github.com/matrix-org/matrix-spec-proposals/pull/4108
//! [RFC 8628]: https://datatracker.ietf.org/doc/html/rfc8628
//! [`ClientBuilder::handle_refresh_tokens()`]: crate::ClientBuilder::handle_refresh_tokens()
//! [`Error`]: ruma::api::client::error::Error
//! [`ErrorKind::UnknownToken`]: ruma::api::client::error::ErrorKind::UnknownToken
//! [`Error`]: ruma::api::error::Error
//! [`ErrorKind::UnknownToken`]: ruma::api::error::ErrorKind::UnknownToken
//! [`examples/oauth_cli`]: https://github.com/matrix-org/matrix-rust-sdk/tree/main/examples/oauth_cli
#[cfg(feature = "e2e-encryption")]
Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk/src/authentication/oauth/qrcode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub use oauth2::{
RequestTokenError, StandardErrorResponse,
basic::{BasicErrorResponse, BasicRequestTokenError},
};
use ruma::api::{client::error::ErrorKind, error::FromHttpResponseError};
use ruma::api::error::{ErrorKind, FromHttpResponseError};
use thiserror::Error;
use tokio::sync::Mutex;
use url::Url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn response_to_error(status: StatusCode, body: Vec<u8>) -> HttpError {
match http::Response::builder().status(status).body(body).map_err(IntoHttpError::from) {
Ok(response) => {
let error = FromHttpResponseError::<RumaApiError>::Server(RumaApiError::ClientApi(
ruma::api::client::Error::from_http_response(response),
ruma::api::error::Error::from_http_response(response),
));

error.into()
Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk/src/client/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ impl ClientBuilder {
/// to be able to [restore the session] later.
///
/// [refreshing access tokens]: https://spec.matrix.org/v1.3/client-server-api/#refreshing-access-tokens
/// [`UnknownToken`]: ruma::api::client::error::ErrorKind::UnknownToken
/// [`UnknownToken`]: ruma::api::error::ErrorKind::UnknownToken
/// [restore the session]: Client::restore_session
pub fn handle_refresh_tokens(mut self) -> Self {
self.handle_refresh_tokens = true;
Expand Down
4 changes: 2 additions & 2 deletions crates/matrix-sdk/src/client/futures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ use matrix_sdk_common::{SendOutsideWasm, SyncOutsideWasm, boxed_into_future};
use oauth2::{RequestTokenError, basic::BasicErrorResponseType};
use ruma::api::{
OutgoingRequest,
client::{error::ErrorKind, media},
error::FromHttpResponseError,
client::media,
error::{ErrorKind, FromHttpResponseError},
path_builder::PathBuilder,
};
use tracing::{error, trace};
Expand Down
Loading
Loading