pub type StrippedRoomMemberEvent = StrippedStateEvent<PossiblyRedactedRoomMemberEventContent>;Expand description
An m.room.member event from an invited room preview.
Aliased Type§
pub struct StrippedRoomMemberEvent {
pub content: RoomMemberEventContent,
pub sender: OwnedUserId,
pub state_key: OwnedUserId,
pub origin_server_ts: Option<MilliSecondsSinceUnixEpoch>,
pub unsigned: Option<Raw<StateUnsigned<RoomMemberEventContent>>>,
}Fields§
§content: RoomMemberEventContentData specific to the event type.
sender: OwnedUserIdThe fully-qualified ID of the user who sent this event.
state_key: OwnedUserIdA unique key which defines the overwriting semantics for this piece of room state.
This must be a string type, and is often an empty string.
A state event is keyed by its (type, state_key) tuple. Sending another state event with
the same tuple replaces the previous one.
origin_server_ts: Option<MilliSecondsSinceUnixEpoch>Timestamp on the originating homeserver when this event was sent.
This field is usually stripped, but some events might include it.
unsigned: Option<Raw<StateUnsigned<RoomMemberEventContent>>>Additional key-value pairs not signed by the homeserver.
Implementations§
Source§impl StrippedRoomMemberEvent
impl StrippedRoomMemberEvent
Sourcepub fn details(&self) -> MembershipDetails<'_>
pub fn details(&self) -> MembershipDetails<'_>
Obtain the details about this event that are required to calculate a membership change.
This is required when you want to calculate the change a redacted m.room.member event
made.
Sourcepub fn membership_change<'a>(
&'a self,
prev_details: Option<MembershipDetails<'a>>,
) -> MembershipChange<'a>
pub fn membership_change<'a>( &'a self, prev_details: Option<MembershipDetails<'a>>, ) -> MembershipChange<'a>
Helper function for membership change.
Since stripped events don’t have unsigned.prev_content, you have to pass the .details()
of the previous m.room.member event manually (if there is a previous m.room.member
event).
Check the specification for details.