Struct matrix_sdk_base::RoomMember
source · pub struct RoomMember { /* private fields */ }
Expand description
A member of a room.
Implementations§
source§impl RoomMember
impl RoomMember
sourcepub fn event(&self) -> &Arc<MemberEvent>
pub fn event(&self) -> &Arc<MemberEvent>
Get the original member event
sourcepub fn display_name(&self) -> Option<&str>
pub fn display_name(&self) -> Option<&str>
Get the display name of the member if there is one.
sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Get the name of the member.
This returns either the display name or the local part of the user id if the member didn’t set a display name.
sourcepub fn avatar_url(&self) -> Option<&MxcUri>
pub fn avatar_url(&self) -> Option<&MxcUri>
Get the avatar url of the member, if there is one.
sourcepub fn normalized_power_level(&self) -> i64
pub fn normalized_power_level(&self) -> i64
Get the normalized power level of this member.
The normalized power level depends on the maximum power level that can be found in a certain room, it’s always in the range of 0-100.
sourcepub fn power_level(&self) -> i64
pub fn power_level(&self) -> i64
Get the power level of this member.
sourcepub fn can_ban(&self) -> bool
pub fn can_ban(&self) -> bool
Whether this user can ban other users based on the power levels.
Same as member.can_do(PowerLevelAction::Ban)
.
sourcepub fn can_invite(&self) -> bool
pub fn can_invite(&self) -> bool
Whether this user can invite other users based on the power levels.
Same as member.can_do(PowerLevelAction::Invite)
.
sourcepub fn can_kick(&self) -> bool
pub fn can_kick(&self) -> bool
Whether this user can kick other users based on the power levels.
Same as member.can_do(PowerLevelAction::Kick)
.
sourcepub fn can_redact(&self) -> bool
pub fn can_redact(&self) -> bool
Whether this user can redact events based on the power levels.
Same as member.can_do(PowerLevelAction::Redact)
.
sourcepub fn can_send_message(&self, msg_type: MessageLikeEventType) -> bool
pub fn can_send_message(&self, msg_type: MessageLikeEventType) -> bool
Whether this user can send message events based on the power levels.
Same as member.can_do(PowerLevelAction::SendMessage(msg_type))
.
sourcepub fn can_send_state(&self, state_type: StateEventType) -> bool
pub fn can_send_state(&self, state_type: StateEventType) -> bool
Whether this user can send state events based on the power levels.
Same as member.can_do(PowerLevelAction::SendState(state_type))
.
sourcepub fn can_trigger_room_notification(&self) -> bool
pub fn can_trigger_room_notification(&self) -> bool
Whether this user can notify everybody in the room by writing @room
in
a message.
Same as member. can_do(PowerLevelAction::TriggerNotification(NotificationPowerLevelType::Room))
.
sourcepub fn can_do(&self, action: PowerLevelAction) -> bool
pub fn can_do(&self, action: PowerLevelAction) -> bool
Whether this user can do the given action based on the power levels.
sourcepub fn name_ambiguous(&self) -> bool
pub fn name_ambiguous(&self) -> bool
Is the name that the member uses ambiguous in the room.
A name is considered to be ambiguous if at least one other member shares the same name.
sourcepub fn membership(&self) -> &MembershipState
pub fn membership(&self) -> &MembershipState
Get the membership state of this member.
sourcepub fn is_ignored(&self) -> bool
pub fn is_ignored(&self) -> bool
Is the room member ignored by the current account user
Trait Implementations§
source§impl Clone for RoomMember
impl Clone for RoomMember
source§fn clone(&self) -> RoomMember
fn clone(&self) -> RoomMember
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more