Skip to content

Commit

Permalink
fixup! chore(base): Clean up the display name ambiguity calculation l…
Browse files Browse the repository at this point in the history
…ogic
  • Loading branch information
poljar committed Nov 7, 2024
1 parent f08e545 commit fe85984
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crates/matrix-sdk-base/src/store/ambiguity_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ impl AmbiguityCache {

trace!(user_id = ?member_event.state_key(), "Handling display name ambiguity: {change:#?}");

self.add_change(room_id, member_event.event_id().to_owned(), change);
self.changes
.entry(room_id.to_owned())
.or_default()
.insert(member_event.event_id().to_owned(), change);

Ok(())
}
Expand All @@ -161,10 +164,6 @@ impl AmbiguityCache {
}
}

fn add_change(&mut self, room_id: &RoomId, event_id: OwnedEventId, change: AmbiguityChange) {
self.changes.entry(room_id.to_owned()).or_default().insert(event_id, change);
}

/// Get the previously used display name, if any, of the member described in
/// the given new [`SyncRoomMemberEvent`].
async fn get_old_display_name(
Expand Down

0 comments on commit fe85984

Please sign in to comment.