Type Alias PossiblyRedactedCallMemberEventContent

Source
pub type PossiblyRedactedCallMemberEventContent = CallMemberEventContent;
Expand description

The PossiblyRedacted version of CallMemberEventContent.

Since CallMemberEventContent has the CallMemberEventContent::Empty state it already is compatible with the redacted version of the state event content.

Aliased Type§

enum PossiblyRedactedCallMemberEventContent {
    LegacyContent(LegacyMembershipContent),
    SessionContent(SessionMembershipData),
    Empty(EmptyMembershipData),
}

Variants§

§

LegacyContent(LegacyMembershipContent)

The legacy format for m.call.member events. (An array of memberships. The devices of one user.)

§

SessionContent(SessionMembershipData)

Normal membership events. One event per membership. Multiple state keys will be used to describe multiple devices for one user.

§

Empty(EmptyMembershipData)

An empty content means this user has been in a rtc session but is not anymore.

Implementations

Source§

impl CallMemberEventContent

Source

pub fn new_legacy(memberships: Vec<LegacyMembershipData>) -> Self

Source

pub fn new( application: Application, device_id: OwnedDeviceId, focus_active: ActiveFocus, foci_preferred: Vec<Focus>, created_ts: Option<MilliSecondsSinceUnixEpoch>, ) -> Self

Source

pub fn new_empty(leave_reason: Option<LeaveReason>) -> Self

Creates a new Empty CallMemberEventContent representing a left membership.

Source

pub fn active_memberships( &self, origin_server_ts: Option<MilliSecondsSinceUnixEpoch>, ) -> Vec<MembershipData<'_>>

All non expired memberships in this member event.

In most cases you want to use this method instead of the public memberships field. The memberships field will also include expired events.

This copies all the memberships and converts them

§Arguments
Source

pub fn memberships(&self) -> Vec<MembershipData<'_>>

All the memberships for this event. Can only contain multiple elements in the case of legacy m.call.member state events.

Source

pub fn set_created_ts_if_none( &mut self, origin_server_ts: MilliSecondsSinceUnixEpoch, )

Set the created_ts of each MembershipData::Legacy in this event.

Each call member event contains the origin_server_ts and content.create_ts. content.create_ts is undefined for the initial event of a session (because the origin_server_ts is not known on the client). In the rust sdk we want to copy over the origin_server_ts of the event into the content. (This allows to use MinimalStateEvents and still be able to determine if a membership is expired)

Trait Implementations§

Source§

impl PossiblyRedactedStateEventContent for PossiblyRedactedCallMemberEventContent

Source§

type StateKey = CallMemberStateKey

The type of the event’s state_key field.
Source§

impl Clone for CallMemberEventContent

Source§

fn clone(&self) -> CallMemberEventContent

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CallMemberEventContent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CallMemberEventContent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl EventContent for CallMemberEventContent

Source§

type EventType = StateEventType

The Rust enum for the event kind’s known types.
Source§

fn event_type(&self) -> Self::EventType

Get the event’s type, like m.room.message.
Source§

impl PartialEq for CallMemberEventContent

Source§

fn eq(&self, other: &CallMemberEventContent) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RedactContent for CallMemberEventContent

Source§

type Redacted = RedactedCallMemberEventContent

The redacted form of the event’s content.
Source§

fn redact(self, _version: &RoomVersionId) -> Self::Redacted

Transform self into a redacted form (removing most or all fields) according to the spec. Read more
Source§

impl Serialize for CallMemberEventContent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StateEventContent for CallMemberEventContent

Source§

type StateKey = CallMemberStateKey

The type of the event’s state_key field.
Source§

impl StaticEventContent for CallMemberEventContent

Source§

const TYPE: &'static str = "org.matrix.msc3401.call.member"

The event type.
Source§

impl StaticStateEventContent for CallMemberEventContent

Source§

type PossiblyRedacted = CallMemberEventContent

The possibly redacted form of the event’s content.
Source§

type Unsigned = StateUnsigned<<CallMemberEventContent as StaticStateEventContent>::PossiblyRedacted>

The type of the event’s unsigned field.
Source§

impl StructuralPartialEq for CallMemberEventContent