fix: don't allow inviting other users (not implemented yet)

This commit is contained in:
Timo Kösters 2021-04-21 09:56:50 +02:00
parent 4c4e1f9027
commit e815486030
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4

View file

@ -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,