chore(spaces): use Client::joined_space_rooms within the space service to reduce the number of iterations required

This commit is contained in:
Stefan Ceriu
2025-08-21 10:09:17 +03:00
committed by Stefan Ceriu
parent 3c069f0c5c
commit d43d141dc8

View File

@@ -173,11 +173,7 @@ impl SpaceService {
}
async fn joined_spaces_for(client: &Client) -> Vec<SpaceRoom> {
let joined_spaces = client
.joined_rooms()
.into_iter()
.filter_map(|room| room.is_space().then_some(room))
.collect::<Vec<_>>();
let joined_spaces = client.joined_space_rooms();
// Build a graph to hold the parent-child relations
let mut graph = SpaceGraph::new();