fixup! feat(federation): support /make_join and /send_join for restricted rooms

check event is join membership

Co-Authored-By: Matthias Ahouansou <matthias@ahouansou.cz>
merge-requests/618/head
strawberry 3 days ago committed by Matthias Ahouansou
parent 3a8ed99246
commit 4a6805a517
No known key found for this signature in database

@ -1705,6 +1705,13 @@ async fn create_join_event(
)
.map_err(|_| Error::BadRequest(ErrorKind::BadJson, "Invalid event content"))?;
if event_content.membership != MembershipState::Join {
return Err(Error::BadRequest(
ErrorKind::BadJson,
"Membership of sent event does not match that of the endpoint",
));
}
if event_content
.join_authorized_via_users_server
.map(|user| user.server_name() == services().globals.server_name())

Loading…
Cancel
Save