Get rid of match on membership change in RoomMember::update_profile.
The calling method already did this when it determined that update_profile should be called so we don't need to repeat it.master
parent
5ef9a7b924
commit
9bd8699e18
|
@ -117,20 +117,11 @@ impl RoomMember {
|
||||||
|
|
||||||
/// Handle profile updates.
|
/// Handle profile updates.
|
||||||
pub(crate) fn update_profile(&mut self, event: &MemberEvent) -> bool {
|
pub(crate) fn update_profile(&mut self, event: &MemberEvent) -> bool {
|
||||||
use MembershipChange::*;
|
|
||||||
|
|
||||||
match event.membership_change() {
|
|
||||||
ProfileChanged => {
|
|
||||||
self.display_name = event.content.displayname.clone();
|
self.display_name = event.content.displayname.clone();
|
||||||
self.avatar_url = event.content.avatar_url.clone();
|
self.avatar_url = event.content.avatar_url.clone();
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
// We're only interested in profile changes here.
|
|
||||||
_ => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn update_power(&mut self, event: &PowerLevelsEvent, max_power: Int) -> bool {
|
pub fn update_power(&mut self, event: &PowerLevelsEvent, max_power: Int) -> bool {
|
||||||
let changed;
|
let changed;
|
||||||
if let Some(user_power) = event.content.users.get(&self.user_id) {
|
if let Some(user_power) = event.content.users.get(&self.user_id) {
|
||||||
|
|
Loading…
Reference in New Issue