diff --git a/Cargo.lock b/Cargo.lock index 5e26ad28bfc..75d7c1a55dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5016,7 +5016,7 @@ dependencies = [ [[package]] name = "ruma" version = "0.10.1" -source = "git+https://github.com/ruma/ruma?rev=75e8829bec0b7bc5332860e1fb2df658d5c71d66#75e8829bec0b7bc5332860e1fb2df658d5c71d66" +source = "git+https://github.com/ruma/ruma?rev=c21817436979acbe66d43064498920a6d289b562#c21817436979acbe66d43064498920a6d289b562" dependencies = [ "assign", "js_int", @@ -5033,7 +5033,7 @@ dependencies = [ [[package]] name = "ruma-client-api" version = "0.18.0" -source = "git+https://github.com/ruma/ruma?rev=75e8829bec0b7bc5332860e1fb2df658d5c71d66#75e8829bec0b7bc5332860e1fb2df658d5c71d66" +source = "git+https://github.com/ruma/ruma?rev=c21817436979acbe66d43064498920a6d289b562#c21817436979acbe66d43064498920a6d289b562" dependencies = [ "as_variant", "assign", @@ -5056,7 +5056,7 @@ dependencies = [ [[package]] name = "ruma-common" version = "0.13.0" -source = "git+https://github.com/ruma/ruma?rev=75e8829bec0b7bc5332860e1fb2df658d5c71d66#75e8829bec0b7bc5332860e1fb2df658d5c71d66" +source = "git+https://github.com/ruma/ruma?rev=c21817436979acbe66d43064498920a6d289b562#c21817436979acbe66d43064498920a6d289b562" dependencies = [ "as_variant", "base64 0.22.1", @@ -5088,7 +5088,7 @@ dependencies = [ [[package]] name = "ruma-events" version = "0.28.1" -source = "git+https://github.com/ruma/ruma?rev=75e8829bec0b7bc5332860e1fb2df658d5c71d66#75e8829bec0b7bc5332860e1fb2df658d5c71d66" +source = "git+https://github.com/ruma/ruma?rev=c21817436979acbe66d43064498920a6d289b562#c21817436979acbe66d43064498920a6d289b562" dependencies = [ "as_variant", "indexmap 2.2.6", @@ -5112,7 +5112,7 @@ dependencies = [ [[package]] name = "ruma-federation-api" version = "0.9.0" -source = "git+https://github.com/ruma/ruma?rev=75e8829bec0b7bc5332860e1fb2df658d5c71d66#75e8829bec0b7bc5332860e1fb2df658d5c71d66" +source = "git+https://github.com/ruma/ruma?rev=c21817436979acbe66d43064498920a6d289b562#c21817436979acbe66d43064498920a6d289b562" dependencies = [ "js_int", "ruma-common", @@ -5124,7 +5124,7 @@ dependencies = [ [[package]] name = "ruma-html" version = "0.2.0" -source = "git+https://github.com/ruma/ruma?rev=75e8829bec0b7bc5332860e1fb2df658d5c71d66#75e8829bec0b7bc5332860e1fb2df658d5c71d66" +source = "git+https://github.com/ruma/ruma?rev=c21817436979acbe66d43064498920a6d289b562#c21817436979acbe66d43064498920a6d289b562" dependencies = [ "as_variant", "html5ever", @@ -5136,7 +5136,7 @@ dependencies = [ [[package]] name = "ruma-identifiers-validation" version = "0.9.5" -source = "git+https://github.com/ruma/ruma?rev=75e8829bec0b7bc5332860e1fb2df658d5c71d66#75e8829bec0b7bc5332860e1fb2df658d5c71d66" +source = "git+https://github.com/ruma/ruma?rev=c21817436979acbe66d43064498920a6d289b562#c21817436979acbe66d43064498920a6d289b562" dependencies = [ "js_int", "thiserror", @@ -5145,7 +5145,7 @@ dependencies = [ [[package]] name = "ruma-macros" version = "0.13.0" -source = "git+https://github.com/ruma/ruma?rev=75e8829bec0b7bc5332860e1fb2df658d5c71d66#75e8829bec0b7bc5332860e1fb2df658d5c71d66" +source = "git+https://github.com/ruma/ruma?rev=c21817436979acbe66d43064498920a6d289b562#c21817436979acbe66d43064498920a6d289b562" dependencies = [ "once_cell", "proc-macro-crate", @@ -5160,7 +5160,7 @@ dependencies = [ [[package]] name = "ruma-push-gateway-api" version = "0.9.0" -source = "git+https://github.com/ruma/ruma?rev=75e8829bec0b7bc5332860e1fb2df658d5c71d66#75e8829bec0b7bc5332860e1fb2df658d5c71d66" +source = "git+https://github.com/ruma/ruma?rev=c21817436979acbe66d43064498920a6d289b562#c21817436979acbe66d43064498920a6d289b562" dependencies = [ "js_int", "ruma-common", diff --git a/Cargo.toml b/Cargo.toml index 2ac19dfd954..8e2b042e15c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,7 @@ once_cell = "1.16.0" pin-project-lite = "0.2.9" rand = "0.8.5" reqwest = { version = "0.12.4", default-features = false } -ruma = { git = "https://github.com/ruma/ruma", rev = "75e8829bec0b7bc5332860e1fb2df658d5c71d66", features = [ +ruma = { git = "https://github.com/ruma/ruma", rev = "c21817436979acbe66d43064498920a6d289b562", features = [ "client-api-c", "compat-upload-signatures", "compat-user-id", @@ -55,7 +55,7 @@ ruma = { git = "https://github.com/ruma/ruma", rev = "75e8829bec0b7bc5332860e1fb "unstable-msc3266", "unstable-msc4075" ] } -ruma-common = { git = "https://github.com/ruma/ruma", rev = "75e8829bec0b7bc5332860e1fb2df658d5c71d66" } +ruma-common = { git = "https://github.com/ruma/ruma", rev = "c21817436979acbe66d43064498920a6d289b562" } serde = "1.0.151" serde_html_form = "0.2.0" serde_json = "1.0.91" diff --git a/bindings/matrix-sdk-ffi/src/room.rs b/bindings/matrix-sdk-ffi/src/room.rs index b946ab515ac..05281a1dd3c 100644 --- a/bindings/matrix-sdk-ffi/src/room.rs +++ b/bindings/matrix-sdk-ffi/src/room.rs @@ -134,7 +134,7 @@ impl Room { /// Returns a Vec of userId's that participate in the room call. /// - /// matrix_rtc memberships with application "m.call" and scope "m.room" are + /// MatrixRTC memberships with application "m.call" and scope "m.room" are /// considered. A user can occur twice if they join with two devices. /// convert to a set depending if the different users are required or the /// amount of sessions. diff --git a/crates/matrix-sdk-base/src/rooms/normal.rs b/crates/matrix-sdk-base/src/rooms/normal.rs index 0c0b5d996ca..9443f98d1ca 100644 --- a/crates/matrix-sdk-base/src/rooms/normal.rs +++ b/crates/matrix-sdk-base/src/rooms/normal.rs @@ -29,7 +29,7 @@ use ruma::events::AnySyncTimelineEvent; use ruma::{ api::client::sync::sync_events::v3::RoomSummary as RumaSummary, events::{ - call::member::Membership, + call::member::MembershipData, ignored_user_list::IgnoredUserListEventContent, receipt::{Receipt, ReceiptThread, ReceiptType}, room::{ @@ -462,7 +462,7 @@ impl Room { /// Returns a Vec of userId's that participate in the room call. /// - /// matrix_rtc memberships with application "m.call" and scope "m.room" are + /// MatrixRTC memberships with application "m.call" and scope "m.room" are /// considered. A user can occur twice if they join with two devices. /// convert to a set depending if the different users are required or the /// amount of sessions. @@ -1289,7 +1289,7 @@ impl RoomInfo { /// associated UserId's in this room. /// /// The vector is ordered by oldest membership to newest. - fn active_matrix_rtc_memberships(&self) -> Vec<(OwnedUserId, &Membership)> { + fn active_matrix_rtc_memberships(&self) -> Vec<(OwnedUserId, MembershipData<'_>)> { let mut v = self .base_info .rtc_member @@ -1304,7 +1304,7 @@ impl RoomInfo { }) .flatten() .collect::>(); - v.sort_by_key(|(_, m)| m.created_ts); + v.sort_by_key(|(_, m)| m.created_ts()); v } @@ -1313,7 +1313,7 @@ impl RoomInfo { /// returns Memberships with application "m.call" and scope "m.room". /// /// The vector is ordered by oldest membership user to newest. - fn active_room_call_memberships(&self) -> Vec<(OwnedUserId, &Membership)> { + fn active_room_call_memberships(&self) -> Vec<(OwnedUserId, MembershipData<'_>)> { self.active_matrix_rtc_memberships() .into_iter() .filter(|(_user_id, m)| m.is_room_call()) @@ -1485,8 +1485,9 @@ mod tests { api::client::sync::sync_events::v3::RoomSummary as RumaSummary, events::{ call::member::{ - Application, CallApplicationContent, CallMemberEventContent, Focus, LivekitFocus, - Membership, MembershipInit, OriginalSyncCallMemberEvent, + Application, CallApplicationContent, CallMemberEventContent, Focus, + LegacyMembershipData, LegacyMembershipDataInit, LivekitFocus, + OriginalSyncCallMemberEvent, }, room::{ canonical_alias::RoomCanonicalAliasEventContent, @@ -2341,11 +2342,11 @@ mod tests { } fn call_member_state_event( - memberships: Vec, + memberships: Vec, ev_id: &str, user_id: &UserId, ) -> AnySyncStateEvent { - let content = CallMemberEventContent::new(memberships); + let content = CallMemberEventContent::new_legacy(memberships); AnySyncStateEvent::CallMember(SyncStateEvent::Original(OriginalSyncCallMemberEvent { content, @@ -2363,7 +2364,7 @@ mod tests { device_id: &str, membership_id: &str, minutes_ago: u32, - ) -> Membership { + ) -> LegacyMembershipData { let application = Application::Call(CallApplicationContent::new( "my_call_id_1".to_owned(), ruma::events::call::member::CallScope::Room, @@ -2374,7 +2375,7 @@ mod tests { ))]; assign!( - Membership::from(MembershipInit { + LegacyMembershipData::from(LegacyMembershipDataInit { application, device_id: device_id.to_owned(), expires: Duration::from_millis(3_600_000), diff --git a/crates/matrix-sdk-base/src/sliding_sync.rs b/crates/matrix-sdk-base/src/sliding_sync.rs index 42c0f52b174..80348964ef6 100644 --- a/crates/matrix-sdk-base/src/sliding_sync.rs +++ b/crates/matrix-sdk-base/src/sliding_sync.rs @@ -713,7 +713,7 @@ fn process_room_properties(room_data: &v4::SlidingSyncRoom, room_info: &mut Room if let Some(heroes) = &room_data.heroes { // Filter out all the heroes which don't have a user id or name. room_info.update_heroes( - heroes.iter().filter_map(|hero| hero.user_id.as_ref()).cloned().collect(), + heroes.iter().map(|hero| &hero.user_id).cloned().collect(), heroes.iter().filter_map(|hero| hero.name.as_ref()).cloned().collect(), ); } @@ -1351,12 +1351,10 @@ mod tests { // in `heroes`) let mut room = v4::SlidingSyncRoom::new(); room.heroes = Some(vec![ - assign!(v4::SlidingSyncRoomHero::default(), { - user_id: Some(gordon), + assign!(v4::SlidingSyncRoomHero::new(gordon), { name: Some("Gordon".to_owned()), }), - assign!(v4::SlidingSyncRoomHero::default(), { - user_id: Some(alice), + assign!(v4::SlidingSyncRoomHero::new(alice), { name: Some("Alice".to_owned()), }), ]);