diff --git a/crates/matrix-sdk-base/src/client.rs b/crates/matrix-sdk-base/src/client.rs index bdd81e25496..6740a4e2905 100644 --- a/crates/matrix-sdk-base/src/client.rs +++ b/crates/matrix-sdk-base/src/client.rs @@ -523,10 +523,22 @@ impl BaseClient { Ok(timeline) } + /// Handles the stripped state events in `invite_state`, modifying the + /// room's info and posting notifications as needed. + /// + /// * `room` - The [`Room`] to modify. + /// * `events` - The contents of `invite_state` in the form of list of pairs + /// of raw stripped state events with their deserialized counterpart. + /// * `push_rules` - The push rules for this room. + /// * `room_info` - The current room's info. + /// * `changes` - The accumulated list of changes to apply once the + /// processing is finished. + /// * `notifications` - Notifications to post for the current room. #[instrument(skip_all, fields(room_id = ?room_info.room_id))] pub(crate) async fn handle_invited_state( &self, room: &Room, + // A list of pairs of raw stripped state events with their deserialized counterpart events: &[(Raw, AnyStrippedStateEvent)], push_rules: &Ruleset, room_info: &mut RoomInfo, diff --git a/crates/matrix-sdk-base/src/sliding_sync/mod.rs b/crates/matrix-sdk-base/src/sliding_sync/mod.rs index 3523e4829aa..0729bd3e349 100644 --- a/crates/matrix-sdk-base/src/sliding_sync/mod.rs +++ b/crates/matrix-sdk-base/src/sliding_sync/mod.rs @@ -1091,7 +1091,7 @@ mod tests { } #[async_test] - async fn test_knocked_room_membership_event() { + async fn test_receiving_a_knocked_room_membership_event_creates_a_knocked_room() { // Given a logged-in client, let client = logged_in_base_client(None).await; let room_id = room_id!("!r:e.uk"); @@ -1111,7 +1111,8 @@ mod tests { } #[async_test] - async fn test_knocked_room_membership_event_with_wrong_state_key() { + async fn test_receiving_a_knocked_room_membership_event_with_wrong_state_key_creates_an_invited_room( + ) { // Given a logged-in client, let client = logged_in_base_client(None).await; let room_id = room_id!("!r:e.uk"); @@ -1131,7 +1132,8 @@ mod tests { } #[async_test] - async fn test_unknown_room_membership_event_in_invite_state() { + async fn test_receiving_an_unknown_room_membership_event_in_invite_state_creates_an_invited_room( + ) { // Given a logged-in client, let client = logged_in_base_client(None).await; let room_id = room_id!("!r:e.uk");