Skip to main content

RedactedRoomMemberEvent

Type Alias RedactedRoomMemberEvent 

Source
pub type RedactedRoomMemberEvent = RedactedStateEvent<RedactedRoomMemberEventContent>;
Expand description

An m.room.member event that has been redacted.

Aliased Type§

pub struct RedactedRoomMemberEvent {
    pub content: RedactedRoomMemberEventContent,
    pub event_id: OwnedEventId,
    pub sender: OwnedUserId,
    pub origin_server_ts: MilliSecondsSinceUnixEpoch,
    pub room_id: OwnedRoomId,
    pub state_key: OwnedUserId,
    pub unsigned: RedactedUnsigned,
}

Fields§

§content: RedactedRoomMemberEventContent

Data specific to the event type.

§event_id: OwnedEventId

The globally unique identifier for the event.

§sender: OwnedUserId

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

§origin_server_ts: MilliSecondsSinceUnixEpoch

Timestamp on the originating homeserver when this event was sent.

§room_id: OwnedRoomId

The ID of the room associated with this event.

§state_key: OwnedUserId

A 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: RedactedUnsigned

Additional key-value pairs not signed by the homeserver.

Implementations§

Source§

impl RedactedRoomMemberEvent

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 membership_change<'a>( &'a self, prev_details: Option<MembershipDetails<'a>>, ) -> MembershipChange<'a>

Helper function for membership change.

Since redacted 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.

Source

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.