matrix-dart-sdk/lib/matrix_api_lite
Nicolas Werner 15dce00c0f
fix: don't convert archived rooms to joined rooms by accident
When decrypting the last event for archived rooms when a room key is
received, we used to send a synthetic SyncUpdate. This however put the
archived room into the join section, which converted the room to a
joined room. We need to respect what section the room was in when
sending synthetic SyncUpdates.

fixes https://github.com/famedly/matrix-dart-sdk/issues/1916
2024-09-18 11:11:35 +02:00
..
generated perf: check event size in bytes without encoding twice 2024-05-20 16:40:15 +02:00
model fix: don't convert archived rooms to joined rooms by accident 2024-09-18 11:11:35 +02:00
utils chore: merge api_lite and dart sdk 2024-03-25 17:22:05 +05:30
README.md chore: add api lite readme 2024-03-25 17:46:59 +05:30
matrix_api.dart refactor: Remove Matrix Connection Exception 2024-06-25 15:48:12 +02:00
values.dart chore: merge api_lite and dart sdk 2024-03-25 17:22:05 +05:30

README.md

Matrix API Lite

This package is a dead simple data model over the client-server specification of https://matrix.org and is mostly used as a base for a more complete Matrix SDK. It doesn't contain any logic and just provides methods for all API endpoints and json parser for all objects. It is intended to be as close to the specificaton as possible so we get a 1:1 relationship with the API. More complex logic like a sync loop or a data model for rooms should be implemented in a more complete Matrix SDK.

Usage

A simple usage example:

import 'package:matrix/matrix_api_lite.dart';

void main() async {
  final api = MatrixApi(homeserver: Uri.parse('https://matrix.org'));
  final capabilities = await api.requestServerCapabilities();
  print(capabilities.toJson());
}

Generated code

The files in lib/src/generated are generated by dart_openapi_codegen from matrix-spec.

To regenerate the code, follow these steps:

  1. Clone both repositories next to each other 1.1 git clone git@github.com:famedly/dart_openapi_codegen.git 1.2 git clone git@github.com:famedly/matrix-dart-sdk.git
  2. Execute the script in the dart_openapi_codegen directory:
cd dart_openapi_codegen
./scripts/matrix.sh ../matrix-dart-sdk/lib/matrix_api_lite/generated
cd ..
  1. Run the build_runner in the matrix_api_lite directory to generate enhanced_enum stuff:
cd matrix-dart-sdk
dart pub get
dart run build_runner build
  1. Check lints and tests and create a merge request