diff --git a/src/api/client/membership.rs b/src/api/client/membership.rs index 470db6693..379070f7c 100644 --- a/src/api/client/membership.rs +++ b/src/api/client/membership.rs @@ -1369,7 +1369,7 @@ pub(crate) async fn invite_helper( services: &Services, sender_user: &UserId, user_id: &UserId, room_id: &RoomId, reason: Option, is_direct: bool, ) -> Result<()> { - if !services.users.is_admin(user_id)? && services.globals.block_non_admin_invites() { + if !services.users.is_admin(sender_user)? && services.globals.block_non_admin_invites() { info!("User {sender_user} is not an admin and attempted to send an invite to room {room_id}"); return Err(Error::BadRequest( ErrorKind::forbidden(),