Type Definition ruma::events::room::member::MemberEvent [−][src]
type MemberEvent = StateEvent<MemberEventContent>;
events
only.Expand description
The current membership state of a user in the room.
Adjusts the membership state for a user in a room. It is preferable to use the membership
APIs (/rooms/<room id>/invite
etc) when performing membership actions rather than
adjusting the state directly as there are a restricted set of valid transformations. For
example, user A cannot force user B to join a room, and trying to force this state change
directly will fail.
The third_party_invite
property will be set if this invite is an invite event and is the
successor of an m.room.third_party_invite event, and absent otherwise.
This event may also include an invite_room_state
key inside the event’s unsigned data. If
present, this contains an array of StrippedState
events. These events provide information
on a subset of state events such as the room name. Note that ruma-events treats unsigned
data on events as arbitrary JSON values, and the ruma-events types for this event don’t
provide direct access to invite_room_state
. If you need this data, you must extract and
convert it from a serde_json::Value
yourself.
The user for which a membership applies is represented by the state_key
. Under some
conditions, the sender
and state_key
may not match - this may be interpreted as the
sender
affecting the membership state of the state_key
user.
The membership for a given user can change over time. Previous membership can be retrieved
from the prev_content
object on an event. If not present, the user’s previous membership
must be assumed as leave.