Skip to main content

image_packs

Function image_packs 

Source
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:

  1. The packs that the user enabled globally through their m.image_pack.rooms account data. The ones of rooms the user isn’t in are skipped, as their images can’t be accessed.
  2. The packs defined in the room’s state.
  3. 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.