# prepareRoomList method

Future <void> prepareRoomList(

1. List <MUCRoomJoin> rooms

)

Prepares the internal room list to ensure that the rooms `rooms` are joined once we are connected.

## Implementation

    Future<void> prepareRoomList(List<MUCRoomJoin> rooms) async {
      assert(
        rooms.isNotEmpty,
        'The room list should not be empty',
      );

      await _cacheLock.synchronized(() {
        _joinedPreparedRooms = false;
        for (final room in rooms) {
          final (roomJid, nick) = room;
          _mucRoomCache[roomJid] = RoomState(
            roomJid: roomJid,
            nick: nick,
            joined: false,
          );
        }
      });
    }