mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-18 21:52:30 -04:00
Fix comments from review feedback
This commit is contained in:
@@ -85,11 +85,13 @@ pub enum RoomState {
|
||||
|
||||
impl From<&MembershipState> for RoomState {
|
||||
fn from(membership_state: &MembershipState) -> Self {
|
||||
// We consider Ban, Knock and Leave to be Left, because they all mean we are not
|
||||
// in the room.
|
||||
match membership_state {
|
||||
MembershipState::Ban => Self::Left, // TODO: is this right?
|
||||
MembershipState::Ban => Self::Left,
|
||||
MembershipState::Invite => Self::Invited,
|
||||
MembershipState::Join => Self::Joined,
|
||||
MembershipState::Knock => Self::Left, // TODO: is this right?
|
||||
MembershipState::Knock => Self::Left,
|
||||
MembershipState::Leave => Self::Left,
|
||||
_ => panic!("Unexpected MembershipState: {}", membership_state),
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ mod test {
|
||||
set_room_left(&mut room, user_id);
|
||||
let response = response_with_room(room_id, room).await;
|
||||
client.process_sliding_sync(&response).await.expect("Failed to process sync");
|
||||
// (sanity: state is invite)
|
||||
// (sanity: state is left)
|
||||
assert_eq!(client.get_room(room_id).unwrap().state(), RoomState::Left);
|
||||
|
||||
// And then get invited back
|
||||
|
||||
Reference in New Issue
Block a user