mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix: Fix membership check in kick handler
This commit is contained in:
@@ -24,9 +24,14 @@ pub(crate) async fn kick_user_route(
|
|||||||
if !services
|
if !services
|
||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
.is_joined(&body.user_id, &body.room_id)
|
.user_membership(&body.user_id, &body.room_id)
|
||||||
.await
|
.await
|
||||||
{
|
.is_some_and(|membership| {
|
||||||
|
matches!(
|
||||||
|
membership,
|
||||||
|
MembershipState::Invite | MembershipState::Join | MembershipState::Knock
|
||||||
|
)
|
||||||
|
}) {
|
||||||
return Err!(Request(Forbidden("You cannot kick users who are not in the room.")));
|
return Err!(Request(Forbidden("You cannot kick users who are not in the room.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user