Module ruma::state_res::event_auth[][src]

This is supported on crate feature state-res only.

Functions

auth_check

Authenticate the incoming event. The steps of authentication are:

auth_types_for_event

For the given event kind what are the relevant auth events that are needed to authenticate this content.

can_federate

Can this room federate based on its m.room.create event.

can_send_event

Is the user allowed to send a specific event based on the rooms power levels. Does the event have the correct userId as it’s state_key if it’s not the “” state_key.

can_send_invite

Check user can send invite.

check_event_sender_in_room

Is the event’s sender in the room that they sent the event to.

check_membership

Check that the member event matches state.

check_power_levels

Confirm that the event sender has the required power levels.

check_redaction

Does the event redacting come from a user with enough power to redact the given event.

get_named_level

Helper function to fetch a field, name, from a “m.room.power_level” event’s content. or return default if no power level event is found or zero if no field matches name.

get_send_level

Helper function to fetch the power level needed to send an event of type e_type based on the rooms “m.room.power_level” event.

get_user_power_level

Helper function to fetch a users default power level from a “m.room.power_level” event’s users object.

valid_membership_change

Does the user who sent this member event have required power levels to do so.

verify_third_party_invite