Type Alias ruma_events::room::member::OriginalSyncRoomMemberEvent

source ·
pub type OriginalSyncRoomMemberEvent = OriginalSyncStateEvent<RoomMemberEventContent>;
Expand description

An m.room.member event from a sync_events response.

Aliased Type§

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: RoomMemberEventContent

Data specific to the event type.

§event_id: OwnedEventId

The globally unique event identifier for the user who sent the event.

§sender: OwnedUserId

The fully-qualified ID of the user who sent this event.

§origin_server_ts: MilliSecondsSinceUnixEpoch

Timestamp in milliseconds on originating homeserver when this event was sent.

§state_key: OwnedUserId

A unique key which defines the overwriting semantics for this piece of room state.

This is often an empty string, but some events send a UserId to show which user the event affects.

§unsigned: RoomMemberUnsigned

Additional key-value pairs not signed by the homeserver.

Implementations§

source§

impl OriginalSyncRoomMemberEvent

source

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.

source

pub fn prev_content(&self) -> Option<&RoomMemberEventContent>

Get a reference to the prev_content in unsigned, if it exists.

Shorthand for event.unsigned.prev_content.as_ref()

source

pub fn membership_change(&self) -> MembershipChange<'_>

Helper function for membership change.

Check the specification for details.