diff --git a/src/api/client_server/membership.rs b/src/api/client_server/membership.rs index a1908327..4fad8cf2 100644 --- a/src/api/client_server/membership.rs +++ b/src/api/client_server/membership.rs @@ -317,15 +317,6 @@ pub(crate) async fn invite_user_route(body: Ruma) -> R pub(crate) async fn kick_user_route(body: Ruma) -> Result { let sender_user = body.sender_user.as_ref().expect("user is authenticated"); - if let Ok(true) = services() - .rooms - .state_cache - .is_left(sender_user, &body.room_id) - { - info!("{} is not in room {}", &body.user_id, &body.room_id); - return Ok(kick_user::v3::Response {}); - } - let mut event: RoomMemberEventContent = serde_json::from_str( services() .rooms @@ -382,17 +373,6 @@ pub(crate) async fn kick_user_route(body: Ruma) -> Resul pub(crate) async fn ban_user_route(body: Ruma) -> Result { let sender_user = body.sender_user.as_ref().expect("user is authenticated"); - if let Ok(Some(membership_event)) = services() - .rooms - .state_accessor - .get_member(&body.room_id, sender_user) - { - if membership_event.membership == MembershipState::Ban { - info!("{} is already banned in {}", &body.user_id, &body.room_id); - return Ok(ban_user::v3::Response {}); - } - } - let event = services() .rooms .state_accessor @@ -462,17 +442,6 @@ pub(crate) async fn ban_user_route(body: Ruma) -> Result< pub(crate) async fn unban_user_route(body: Ruma) -> Result { let sender_user = body.sender_user.as_ref().expect("user is authenticated"); - if let Ok(Some(membership_event)) = services() - .rooms - .state_accessor - .get_member(&body.room_id, sender_user) - { - if membership_event.membership != MembershipState::Ban { - info!("{} is already unbanned in {}", &body.user_id, &body.room_id); - return Ok(unban_user::v3::Response {}); - } - } - let mut event: RoomMemberEventContent = serde_json::from_str( services() .rooms