Add accessor for room member avatar urls
parent
bab8fde0ac
commit
aadbc14dc6
|
@ -56,6 +56,13 @@ impl RoomMember {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn avatar_url(&self) -> Option<&str> {
|
||||||
|
match self.profile.as_ref() {
|
||||||
|
Some(p) => p.avatar_url.as_deref(),
|
||||||
|
None => self.event.content.avatar_url.as_deref(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn normalized_power_level(&self) -> i64 {
|
pub fn normalized_power_level(&self) -> i64 {
|
||||||
if self.max_power_level > 0 {
|
if self.max_power_level > 0 {
|
||||||
(self.power_level() * 100) / self.max_power_level
|
(self.power_level() * 100) / self.max_power_level
|
||||||
|
|
Loading…
Reference in New Issue