Function check_state_independent_auth_rules

Source
pub fn check_state_independent_auth_rules<E: Event>(
    rules: &AuthorizationRules,
    incoming_event: impl Event,
    fetch_event: impl Fn(&EventId) -> Option<E>,
) -> Result<(), String>
Expand description

Check whether the incoming event passes the state-independent authorization rules for the given room version rules.

The state-independent rules are the first few authorization rules that check an incoming m.room.create event (which cannot have auth_events), and the list of auth_events of other events.

This method only needs to be called once, when the event is received.

ยงErrors

If the check fails, this returns an Err(_) with a description of the check that failed.