This refactoring allows adding logic that uses the event context before persisting it.
This reverts commit cc51aaaa7a. The PR was prematurely merged and not yet approved.
cc51aaaa7a
When receiving a /send_join request for a room with join rules set to 'restricted', check if the user is a member of the spaces defined in the 'allow' key of the join rules. This only applies to an experimental room version, as defined in MSC3083.