room: Generate human-readable ID for logs

This commit is contained in:
Kévin Commaille 2023-04-24 14:53:11 +02:00
parent b064698a27
commit 9d7b31e502
No known key found for this signature in database
GPG key ID: DD507DAE96E8245C

View file

@ -1595,4 +1595,11 @@ impl Room {
pub fn to_pill(&self) -> Pill {
Pill::for_room(self)
}
/// Get a human-readable ID for this `Room`.
///
/// This is to identify the room easily in logs.
pub fn human_readable_id(&self) -> String {
format!("{} ({})", self.display_name(), self.room_id())
}
}