mirror of
https://github.com/youwen5/iamb.git
synced 2025-06-19 21:29:52 -07:00
Support custom sorting for room and user lists (#170)
This commit is contained in:
parent
443ad241b4
commit
8943909f06
7 changed files with 500 additions and 119 deletions
|
@ -330,34 +330,30 @@ async fn refresh_rooms(client: &Client, store: &AsyncProgramStore) {
|
|||
|
||||
for room in client.invited_rooms().into_iter() {
|
||||
let name = room.display_name().await.unwrap_or(DisplayName::Empty).to_string();
|
||||
let tags = room.tags().await.unwrap_or_default();
|
||||
|
||||
names.push((room.room_id().to_owned(), name));
|
||||
|
||||
if room.is_direct() {
|
||||
let tags = room.tags().await.unwrap_or_default();
|
||||
|
||||
dms.push(Arc::new((room.into(), tags)));
|
||||
} else if room.is_space() {
|
||||
spaces.push(room.into());
|
||||
spaces.push(Arc::new((room.into(), tags)));
|
||||
} else {
|
||||
let tags = room.tags().await.unwrap_or_default();
|
||||
|
||||
rooms.push(Arc::new((room.into(), tags)));
|
||||
}
|
||||
}
|
||||
|
||||
for room in client.joined_rooms().into_iter() {
|
||||
let name = room.display_name().await.unwrap_or(DisplayName::Empty).to_string();
|
||||
let tags = room.tags().await.unwrap_or_default();
|
||||
|
||||
names.push((room.room_id().to_owned(), name));
|
||||
|
||||
if room.is_direct() {
|
||||
let tags = room.tags().await.unwrap_or_default();
|
||||
|
||||
dms.push(Arc::new((room.into(), tags)));
|
||||
} else if room.is_space() {
|
||||
spaces.push(room.into());
|
||||
spaces.push(Arc::new((room.into(), tags)));
|
||||
} else {
|
||||
let tags = room.tags().await.unwrap_or_default();
|
||||
|
||||
rooms.push(Arc::new((room.into(), tags)));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue