Skip to content

Commit

Permalink
fixup! Revert "feat(knocking): use handle_stripped_state_event to c…
Browse files Browse the repository at this point in the history
…heck the membership state event"
  • Loading branch information
jmartinesp committed Oct 16, 2024
1 parent 8033c84 commit 687166e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
12 changes: 12 additions & 0 deletions crates/matrix-sdk-base/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>, AnyStrippedStateEvent)],
push_rules: &Ruleset,
room_info: &mut RoomInfo,
Expand Down
8 changes: 5 additions & 3 deletions crates/matrix-sdk-base/src/sliding_sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand All @@ -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");
Expand Down

0 comments on commit 687166e

Please sign in to comment.