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,18 +117,9 @@ 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::*;
|
self.display_name = event.content.displayname.clone();
|
||||||
|
self.avatar_url = event.content.avatar_url.clone();
|
||||||
match event.membership_change() {
|
true
|
||||||
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,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update_power(&mut self, event: &PowerLevelsEvent, max_power: Int) -> bool {
|
pub fn update_power(&mut self, event: &PowerLevelsEvent, max_power: Int) -> bool {
|
||||||
|
|
Loading…
Reference in New Issue