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
Denis Kasak 2020-06-30 15:01:03 +02:00
parent 5ef9a7b924
commit 9bd8699e18
1 changed files with 3 additions and 12 deletions

View File

@ -117,18 +117,9 @@ impl RoomMember {
/// Handle profile updates.
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.avatar_url = event.content.avatar_url.clone();
true
}
// We're only interested in profile changes here.
_ => false,
}
self.display_name = event.content.displayname.clone();
self.avatar_url = event.content.avatar_url.clone();
true
}
pub fn update_power(&mut self, event: &PowerLevelsEvent, max_power: Int) -> bool {