fix incorrect user id for non-admin invites checking

This commit is contained in:
OverPhoenix 2024-11-10 21:45:37 +00:00 committed by Jason Volk
parent 1efc52c440
commit 24a5ecb6b4

View file

@ -1306,7 +1306,7 @@ pub(crate) async fn invite_helper(
services: &Services, sender_user: &UserId, user_id: &UserId, room_id: &RoomId, reason: Option<String>,
is_direct: bool,
) -> Result<()> {
if !services.users.is_admin(user_id).await && services.globals.block_non_admin_invites() {
if !services.users.is_admin(sender_user).await && 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(),