Use canonical alias in buflist when possible
This commit is contained in:
@ -288,7 +288,14 @@ impl RoomBuffer {
|
|||||||
#[async_trait]
|
#[async_trait]
|
||||||
impl Buffer for RoomBuffer {
|
impl Buffer for RoomBuffer {
|
||||||
fn short_name(&self) -> String {
|
fn short_name(&self) -> String {
|
||||||
self.room_id.as_str().to_owned()
|
self
|
||||||
|
.buffers
|
||||||
|
.iter()
|
||||||
|
.flat_map(|buf| buf.client.get_room(&self.room_id))
|
||||||
|
.flat_map(|room| room.canonical_alias()) // TODO: .display_name() is better, but async :(
|
||||||
|
.map(|alias| alias.as_str().to_owned())
|
||||||
|
.next()
|
||||||
|
.unwrap_or(self.room_id.as_str().to_owned())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn room_id(&self) -> Option<&RoomId> {
|
fn room_id(&self) -> Option<&RoomId> {
|
||||||
|
Reference in New Issue
Block a user