#[non_exhaustive]pub struct RedactedRoomMemberEventContent {
pub membership: MembershipState,
pub third_party_invite: Option<RedactedThirdPartyInvite>,
pub join_authorized_via_users_server: Option<OwnedUserId>,
}
events
only.Expand description
A member event that has been redacted.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.membership: MembershipState
The membership state of this user.
third_party_invite: Option<RedactedThirdPartyInvite>
If this member event is the successor to a third party invitation, this field will contain information about that invitation.
An arbitrary user who has the power to issue invites.
This is redacted in room versions 8 and below. It is used for validating joins when the join rule is restricted.
Implementations§
Source§impl RedactedRoomMemberEventContent
impl RedactedRoomMemberEventContent
Sourcepub fn new(membership: MembershipState) -> RedactedRoomMemberEventContent
pub fn new(membership: MembershipState) -> RedactedRoomMemberEventContent
Create a RedactedRoomMemberEventContent
with the given membership.
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>>,
sender: &UserId,
state_key: &UserId,
) -> MembershipChange<'a>
pub fn membership_change<'a>( &'a self, prev_details: Option<MembershipDetails<'a>>, sender: &UserId, state_key: &UserId, ) -> 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).
This also requires data from the full event:
- The sender of the event,
- The state key of the event.
Check the specification for details.
Trait Implementations§
Source§impl Clone for RedactedRoomMemberEventContent
impl Clone for RedactedRoomMemberEventContent
Source§fn clone(&self) -> RedactedRoomMemberEventContent
fn clone(&self) -> RedactedRoomMemberEventContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'de> Deserialize<'de> for RedactedRoomMemberEventContent
impl<'de> Deserialize<'de> for RedactedRoomMemberEventContent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RedactedRoomMemberEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RedactedRoomMemberEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl EventContent for RedactedRoomMemberEventContent
impl EventContent for RedactedRoomMemberEventContent
Source§type EventType = StateEventType
type EventType = StateEventType
Source§fn event_type(&self) -> StateEventType
fn event_type(&self) -> StateEventType
m.room.message
.Source§impl RedactedStateEventContent for RedactedRoomMemberEventContent
impl RedactedStateEventContent for RedactedRoomMemberEventContent
Source§type StateKey = OwnedUserId
type StateKey = OwnedUserId
state_key
field.