pub type OriginalSyncRoomMemberEvent = OriginalSyncStateEvent<RoomMemberEventContent>;Expand description
An m.room.member event from a sync_events response.
Aliased Type§
pub struct OriginalSyncRoomMemberEvent {
pub content: RoomMemberEventContent,
pub event_id: OwnedEventId,
pub sender: OwnedUserId,
pub origin_server_ts: MilliSecondsSinceUnixEpoch,
pub state_key: OwnedUserId,
pub unsigned: RoomMemberUnsigned,
}Fields§
§content: RoomMemberEventContentData specific to the event type.
event_id: OwnedEventIdThe globally unique identifier for the event.
sender: OwnedUserIdThe fully-qualified ID of the user who sent this event.
origin_server_ts: MilliSecondsSinceUnixEpochTimestamp on the originating homeserver when this event was sent.
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.
unsigned: RoomMemberUnsignedAdditional key-value pairs not signed by the homeserver.
Implementations§
Source§impl OriginalSyncRoomMemberEvent
impl OriginalSyncRoomMemberEvent
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 prev_content(&self) -> Option<&PossiblyRedactedRoomMemberEventContent>
pub fn prev_content(&self) -> Option<&PossiblyRedactedRoomMemberEventContent>
Get a reference to the prev_content in unsigned, if it exists.
Shorthand for event.unsigned.prev_content.as_ref()
Sourcepub fn membership_change(&self) -> MembershipChange<'_>
pub fn membership_change(&self) -> MembershipChange<'_>
Helper function for membership change.
Check the specification for details.
Sourcepub fn should_redact_events(&self) -> bool
pub fn should_redact_events(&self) -> bool
Determines whether the user’s events should be redacted based on their membership.
Using MSC4293, if redact_events is true, the sender is different to the state key,
and the membership is ban or leave (kick), true is returned. Otherwise, the flag
should be ignored, and false is returned.
Trait Implementations§
impl RedactionEvent for OriginalSyncRoomMemberEvent
unstable-msc4293 only.