Add Room::calculate_name convenience method.

Signed-off-by: Denis Kasak <dkasak@termina.org.uk>
This commit is contained in:
Denis Kasak 2020-03-31 21:28:48 +02:00
parent df58c60d2e
commit a298b7f9fd
No known key found for this signature in database
GPG key ID: 50D3BAADCE0BC33E

View file

@ -144,6 +144,11 @@ impl Room {
}
}
/// Calculate and return the display name of the room.
pub fn calculate_name(&self) -> String {
self.room_name.calculate_name(&self.room_id, &self.members)
}
fn add_member(&mut self, event: &MemberEvent) -> bool {
if self.members.contains_key(&event.state_key) {
return false;