Add doc comment to RoomName::calculate_name.
parent
e4977d1d2a
commit
4c184a30a2
|
@ -201,9 +201,14 @@ impl RoomName {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Calculate the canonical display name of a room, taking into account its name, aliases and
|
||||||
|
/// members.
|
||||||
|
///
|
||||||
|
/// The display name is calculated according to [this algorithm][spec].
|
||||||
|
///
|
||||||
|
/// [spec]:
|
||||||
|
/// <https://matrix.org/docs/spec/client_server/latest#calculating-the-display-name-for-a-room>
|
||||||
pub fn calculate_name(&self, members: &HashMap<UserId, RoomMember>) -> String {
|
pub fn calculate_name(&self, members: &HashMap<UserId, RoomMember>) -> String {
|
||||||
// https://matrix.org/docs/spec/client_server/latest#calculating-the-display-name-for-a-room.
|
|
||||||
// the order in which we check for a name ^^
|
|
||||||
if let Some(name) = &self.name {
|
if let Some(name) = &self.name {
|
||||||
let name = name.trim();
|
let name = name.trim();
|
||||||
name.to_string()
|
name.to_string()
|
||||||
|
|
Loading…
Reference in New Issue