#[non_exhaustive]pub struct PossiblyRedactedRoomMemberEventContent {
pub avatar_url: Option<OwnedMxcUri>,
pub displayname: Option<String>,
pub is_direct: Option<bool>,
pub membership: MembershipState,
pub third_party_invite: Option<PossiblyRedactedThirdPartyInvite>,
pub blurhash: Option<String>,
pub reason: Option<String>,
pub join_authorized_via_users_server: Option<OwnedUserId>,
}events only.Expand description
The possibly redacted form of RoomMemberEventContent.
This type is used when it’s not obvious whether the content is redacted or not.
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.avatar_url: Option<OwnedMxcUri>The avatar URL for this user, if any.
This is added by the homeserver. If you activate the compat-empty-string-null feature,
this field being an empty string in JSON will result in None here during deserialization.
displayname: Option<String>The display name for this user, if any.
This is added by the homeserver.
is_direct: Option<bool>Flag indicating whether the room containing this event was created with the intention of being a direct chat.
membership: MembershipStateThe membership state of this user.
third_party_invite: Option<PossiblyRedactedThirdPartyInvite>If this member event is the successor to a third party invitation, this field will contain information about that invitation.
blurhash: Option<String>unstable-msc2448 only.reason: Option<String>User-supplied text for why their membership has changed.
For kicks and bans, this is typically the reason for the kick or ban. For other membership changes, this is a way for the user to communicate their intent without having to send a message to the room, such as in a case where Bob rejects an invite from Alice about an upcoming concert, but can’t make it that day.
Clients are not recommended to show this reason to users when receiving an invite due to the potential for spam and abuse. Hiding the reason behind a button or other component is recommended.
Arbitrarily chosen UserId (MxID) of a local user who can send an invite.
Implementations§
Source§impl PossiblyRedactedRoomMemberEventContent
impl PossiblyRedactedRoomMemberEventContent
Sourcepub fn new(
membership: MembershipState,
) -> PossiblyRedactedRoomMemberEventContent
pub fn new( membership: MembershipState, ) -> PossiblyRedactedRoomMemberEventContent
Creates a new PossiblyRedactedRoomMemberEventContent with the given membership state.
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.
This requires data from the full event:
- The previous details computed from
event.unsigned.prev_content, - The sender of the event,
- The state key of the event.
Check the specification for details.
Trait Implementations§
Source§impl Clone for PossiblyRedactedRoomMemberEventContent
impl Clone for PossiblyRedactedRoomMemberEventContent
Source§fn clone(&self) -> PossiblyRedactedRoomMemberEventContent
fn clone(&self) -> PossiblyRedactedRoomMemberEventContent
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 PossiblyRedactedRoomMemberEventContent
impl<'de> Deserialize<'de> for PossiblyRedactedRoomMemberEventContent
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PossiblyRedactedRoomMemberEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PossiblyRedactedRoomMemberEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<PossiblyRedactedRoomMemberEventContent> for AnyPossiblyRedactedStateEventContent
impl From<PossiblyRedactedRoomMemberEventContent> for AnyPossiblyRedactedStateEventContent
Source§fn from(
c: PossiblyRedactedRoomMemberEventContent,
) -> AnyPossiblyRedactedStateEventContent
fn from( c: PossiblyRedactedRoomMemberEventContent, ) -> AnyPossiblyRedactedStateEventContent
Source§impl From<RedactedRoomMemberEventContent> for PossiblyRedactedRoomMemberEventContent
impl From<RedactedRoomMemberEventContent> for PossiblyRedactedRoomMemberEventContent
Source§fn from(
value: RedactedRoomMemberEventContent,
) -> PossiblyRedactedRoomMemberEventContent
fn from( value: RedactedRoomMemberEventContent, ) -> PossiblyRedactedRoomMemberEventContent
Source§impl From<RoomMemberEventContent> for PossiblyRedactedRoomMemberEventContent
impl From<RoomMemberEventContent> for PossiblyRedactedRoomMemberEventContent
Source§fn from(value: RoomMemberEventContent) -> PossiblyRedactedRoomMemberEventContent
fn from(value: RoomMemberEventContent) -> PossiblyRedactedRoomMemberEventContent
Source§impl PossiblyRedactedStateEventContent for PossiblyRedactedRoomMemberEventContent
impl PossiblyRedactedStateEventContent for PossiblyRedactedRoomMemberEventContent
Source§type StateKey = OwnedUserId
type StateKey = OwnedUserId
state_key field.Source§fn event_type(&self) -> StateEventType
fn event_type(&self) -> StateEventType
m.room.name.Source§impl RedactContent for PossiblyRedactedRoomMemberEventContent
impl RedactContent for PossiblyRedactedRoomMemberEventContent
Source§type Redacted = PossiblyRedactedRoomMemberEventContent
type Redacted = PossiblyRedactedRoomMemberEventContent
Source§fn redact(
self,
rules: &RedactionRules,
) -> PossiblyRedactedRoomMemberEventContent
fn redact( self, rules: &RedactionRules, ) -> PossiblyRedactedRoomMemberEventContent
self into a redacted form (removing most or all fields) according to the spec. Read more