pub async fn image_packs(
room: &Room,
space_service: &SpaceService,
) -> Result<Vec<ImagePack>>Expand description
Get the image packs that can be used in a room.
They are returned in the order in which the spec recommends presenting them:
- The packs that the user enabled globally through their
m.image_pack.roomsaccount data. The ones of rooms the user isn’t in are skipped, as their images can’t be accessed. - The packs defined in the room’s state.
- The packs defined in the state of the joined spaces the room belongs to, closest spaces first.
The packs of the same room are sorted by state key. A pack that would appear more than once is only returned the first time. Packs without images are skipped.
All the packs are read from the local state of their rooms, which the
RoomListService requests.