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>
This commit is contained in:
parent
3a8ed99246
commit
4a6805a517
1 changed files with 7 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue