Add short explanation to Room::member_display_name.

master
Denis Kasak 2020-06-09 15:35:43 +02:00
parent 22ba253103
commit e6b67e5fa7
1 changed files with 5 additions and 0 deletions

View File

@ -303,6 +303,11 @@ impl Room {
}
/// Get the disambiguated display name for a member of this room.
///
/// When displaying a room member's display name, clients *must* use this method to obtain the
/// name instead of displaying the `RoomMember::display_name` directly. This is because
/// multiple users can share the same display name in which case the display name has to be
/// disambiguated.
pub fn member_display_name<'a>(&'a self, id: &UserId) -> Option<Cow<'a, str>> {
self.disambiguated_display_names
.get(id)