From cd76448f8b7e50257a93c63dc7aca142364aa30e Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Mon, 12 Apr 2021 09:00:11 +0200 Subject: [PATCH] feat: Add room and event types for spaces --- CHANGELOG.md | 3 +++ lib/src/model/event_types.dart | 4 ++++ lib/src/model/room_types.dart | 29 +++++++++++++++++++++++++++++ pubspec.yaml | 2 +- 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 lib/src/model/room_types.dart diff --git a/CHANGELOG.md b/CHANGELOG.md index d5a278db..03041072 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 0.2.2 +- feat: Add room and event types for spaces + ## 0.2.2 - chore: upgrade logger to 1.0.0 - refactor: upgrade to http 0.13 diff --git a/lib/src/model/event_types.dart b/lib/src/model/event_types.dart index f832d63c..69251296 100644 --- a/lib/src/model/event_types.dart +++ b/lib/src/model/event_types.dart @@ -68,4 +68,8 @@ abstract class EventTypes { static const String MegolmBackup = 'm.megolm_backup.v1'; static const String SecretStorageDefaultKey = 'm.secret_storage.default_key'; static String secretStorageKey(String keyId) => 'm.secret_storage.key.$keyId'; + + // Spaces + static const String spaceParent = 'm.space.parent'; + static const String spaceChild = 'm.space.child'; } diff --git a/lib/src/model/room_types.dart b/lib/src/model/room_types.dart new file mode 100644 index 00000000..ba551ae9 --- /dev/null +++ b/lib/src/model/room_types.dart @@ -0,0 +1,29 @@ +/* MIT License +* +* Copyright (C) 2019, 2020, 2021 Famedly GmbH +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in all +* copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +*/ + +/// Type of a room which is presented in a `m.room.creation` state content in +/// the `type` key. +abstract class RoomCreationTypes { + static const String mSpace = 'm.space'; + static const String mDirectMessage = 'm.dm'; +} diff --git a/pubspec.yaml b/pubspec.yaml index adaba938..e033342d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: matrix_api_lite description: Dead simple data model for the matrix.org client-server API. -version: 0.2.2 +version: 0.2.3 homepage: https://famedly.com environment: