Skip to content

Commit 37626b5

Browse files
authored
Bump Ruma
Signed-off-by: Kévin Commaille <[email protected]>
1 parent d19616d commit 37626b5

File tree

75 files changed

+628
-711
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+628
-711
lines changed

Cargo.lock

Lines changed: 58 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,9 @@ proptest = { version = "1.6.0", default-features = false, features = ["std"] }
5959
rand = "0.8.5"
6060
reqwest = { version = "0.12.12", default-features = false }
6161
rmp-serde = "1.3.0"
62-
# Be careful to use commits from the https://github.com/ruma/ruma/tree/ruma-0.12
63-
# branch until a proper release with breaking changes happens.
64-
ruma = { version = "0.12.5", features = [
62+
ruma = { git = "https://github.com/ruma/ruma", rev = "a3663c04511f79f99376924d739f84d839600de6", features = [
6563
"client-api-c",
6664
"compat-upload-signatures",
67-
"compat-user-id",
6865
"compat-arbitrary-length-ids",
6966
"compat-tag-info",
7067
"compat-encrypted-stickers",
@@ -80,7 +77,7 @@ ruma = { version = "0.12.5", features = [
8077
"unstable-msc4278",
8178
"unstable-msc4286",
8279
] }
83-
ruma-common = "0.15.4"
80+
ruma-common = { git = "https://github.com/ruma/ruma", rev = "a3663c04511f79f99376924d739f84d839600de6" }
8481
sentry = "0.36.0"
8582
sentry-tracing = "0.36.0"
8683
serde = { version = "1.0.217", features = ["rc"] }

bindings/matrix-sdk-crypto-ffi/src/responses.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use ruma::{
2727
to_device::send_event_to_device::v3::Response as ToDeviceResponse,
2828
},
2929
assign,
30-
events::EventContent,
30+
events::MessageLikeEventContent,
3131
OwnedTransactionId, UserId,
3232
};
3333
use serde_json::json;

bindings/matrix-sdk-ffi/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@ All notable changes to this project will be documented in this file.
1515

1616
### Breaking changes:
1717

18+
- `RoomPreview::info()` doesn't return a result anymore. All unknown join rules are handled in the
19+
`JoinRule::Custom` variant.
20+
([#5337](https://github.com/matrix-org/matrix-rust-sdk/pull/5337))
21+
- The `reason` argument of `Room::report_room` is now required, do to a clarification in the spec.
22+
([#5337](https://github.com/matrix-org/matrix-rust-sdk/pull/5337))
23+
- `PublicRoomJoinRule` has more variants, supporting all the known values from the spec.
24+
([#5337](https://github.com/matrix-org/matrix-rust-sdk/pull/5337))
25+
- The fields of `MediaPreviewConfig` are both optional, allowing to use the type for room account
26+
data as well as global account data.
27+
([#5337](https://github.com/matrix-org/matrix-rust-sdk/pull/5337))
1828
- The `event_id` field of `PredecessorRoom` was removed, due to its removal in the Matrix
1929
specification with MSC4291.
2030
([#5419](https://github.com/matrix-org/matrix-rust-sdk/pull/5419))

bindings/matrix-sdk-ffi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ matrix-sdk-ffi-macros.workspace = true
5858
matrix-sdk-ui = { workspace = true, features = ["uniffi"] }
5959
mime = "0.3.16"
6060
once_cell.workspace = true
61-
ruma = { workspace = true, features = ["html", "unstable-unspecified", "unstable-msc3488", "compat-unset-avatar", "unstable-msc3245-v1-compat", "unstable-msc4278"] }
61+
ruma = { workspace = true, features = ["html", "unstable-msc3488", "compat-unset-avatar", "unstable-msc3245-v1-compat", "unstable-msc4278"] }
6262
serde.workspace = true
6363
serde_json.workspace = true
6464
sentry = { version = "0.36.0", optional = true, default-features = false, features = [

bindings/matrix-sdk-ffi/src/client.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,7 +1631,7 @@ impl Client {
16311631
) -> Result<Option<MediaPreviews>, ClientError> {
16321632
let configuration = self.inner.account().get_media_preview_config_event_content().await?;
16331633
match configuration {
1634-
Some(configuration) => Ok(Some(configuration.media_previews.into())),
1634+
Some(configuration) => Ok(configuration.media_previews.map(Into::into)),
16351635
None => Ok(None),
16361636
}
16371637
}
@@ -1652,7 +1652,7 @@ impl Client {
16521652
) -> Result<Option<InviteAvatars>, ClientError> {
16531653
let configuration = self.inner.account().get_media_preview_config_event_content().await?;
16541654
match configuration {
1655-
Some(configuration) => Ok(Some(configuration.invite_avatars.into())),
1655+
Some(configuration) => Ok(configuration.invite_avatars.map(Into::into)),
16561656
None => Ok(None),
16571657
}
16581658
}
@@ -2468,9 +2468,7 @@ impl TryFrom<AllowRule> for RumaAllowRule {
24682468
match value {
24692469
AllowRule::RoomMembership { room_id } => {
24702470
let room_id = RoomId::parse(room_id)?;
2471-
Ok(Self::RoomMembership(ruma::events::room::join_rules::RoomMembership::new(
2472-
room_id,
2473-
)))
2471+
Ok(Self::RoomMembership(ruma::room::RoomMembership::new(room_id)))
24742472
}
24752473
AllowRule::Custom { json } => Ok(Self::_Custom(Box::new(serde_json::from_str(&json)?))),
24762474
}

bindings/matrix-sdk-ffi/src/room/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ impl Room {
484484
/// # Errors
485485
///
486486
/// Returns an error if the room is not found or on rate limit
487-
pub async fn report_room(&self, reason: Option<String>) -> Result<(), ClientError> {
487+
pub async fn report_room(&self, reason: String) -> Result<(), ClientError> {
488488
self.inner.report_room(reason).await?;
489489

490490
Ok(())

bindings/matrix-sdk-ffi/src/room_directory_search.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,21 @@ use crate::{error::ClientError, runtime::get_runtime_handle, task_handle::TaskHa
2828
pub enum PublicRoomJoinRule {
2929
Public,
3030
Knock,
31+
Restricted,
32+
KnockRestricted,
33+
Invite,
3134
}
3235

33-
impl TryFrom<ruma::directory::PublicRoomJoinRule> for PublicRoomJoinRule {
36+
impl TryFrom<ruma::room::JoinRuleKind> for PublicRoomJoinRule {
3437
type Error = String;
3538

36-
fn try_from(value: ruma::directory::PublicRoomJoinRule) -> Result<Self, Self::Error> {
39+
fn try_from(value: ruma::room::JoinRuleKind) -> Result<Self, Self::Error> {
3740
match value {
38-
ruma::directory::PublicRoomJoinRule::Public => Ok(Self::Public),
39-
ruma::directory::PublicRoomJoinRule::Knock => Ok(Self::Knock),
41+
ruma::room::JoinRuleKind::Public => Ok(Self::Public),
42+
ruma::room::JoinRuleKind::Knock => Ok(Self::Knock),
43+
ruma::room::JoinRuleKind::Restricted => Ok(Self::Restricted),
44+
ruma::room::JoinRuleKind::KnockRestricted => Ok(Self::KnockRestricted),
45+
ruma::room::JoinRuleKind::Invite => Ok(Self::Invite),
4046
rule => Err(format!("unsupported join rule: {rule:?}")),
4147
}
4248
}

0 commit comments

Comments
 (0)