From a298b7f9fd19164f4eb3f5f12d65ae8edcad6652 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Tue, 31 Mar 2020 21:28:48 +0200 Subject: [PATCH] Add Room::calculate_name convenience method. Signed-off-by: Denis Kasak --- src/models/room.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/models/room.rs b/src/models/room.rs index 428d7342..ff04b4a1 100644 --- a/src/models/room.rs +++ b/src/models/room.rs @@ -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;