From e815486030cbae0706663051a1ed4f2da1e9caf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6sters?= Date: Wed, 21 Apr 2021 09:56:50 +0200 Subject: [PATCH] fix: don't allow inviting other users (not implemented yet) --- src/client_server/membership.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/client_server/membership.rs b/src/client_server/membership.rs index dcd7c371..7eca676c 100644 --- a/src/client_server/membership.rs +++ b/src/client_server/membership.rs @@ -152,6 +152,13 @@ pub async fn invite_user_route( let sender_user = body.sender_user.as_ref().expect("user is authenticated"); if let invite_user::IncomingInvitationRecipient::UserId { user_id } = &body.recipient { + if body.room_id.server_name() != db.globals.server_name() { + return Err(Error::BadRequest( + ErrorKind::Forbidden, + "Inviting users from other homeservers is not implemented yet.", + )); + } + db.rooms.build_and_append_pdu( PduBuilder { event_type: EventType::RoomMember,