add most models needed for invites
This commit is contained in:
parent
f741a6790d
commit
0df2d8f78b
7 changed files with 61 additions and 4 deletions
21
lib/models/invited_room.dart
Normal file
21
lib/models/invited_room.dart
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
import "package:nexus/models/epoch_date_time_converter.dart";
|
||||
import "package:nexus/models/event.dart";
|
||||
|
||||
part "invited_room.freezed.dart";
|
||||
part "invited_room.g.dart";
|
||||
|
||||
@Freezed(toJson: false, fromJson: false)
|
||||
@JsonSerializable()
|
||||
class const InvitedRoom({
|
||||
required final String roomId,
|
||||
@EpochDateTimeConverter() required final DateTime createdAt,
|
||||
// TODO: This is DBEvent, should be event.Event
|
||||
required final IList<Event> inviteState,
|
||||
}) with _$InvitedRoom {
|
||||
Map<String, Object?> toJson() => _$InvitedRoomToJson(this);
|
||||
|
||||
factory InvitedRoom.fromJson(Map<String, Object?> json) =>
|
||||
_$InvitedRoomFromJson(json);
|
||||
}
|
||||
17
lib/models/requests/get_room_summary.dart
Normal file
17
lib/models/requests/get_room_summary.dart
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
|
||||
part "get_room_summary.freezed.dart";
|
||||
part "get_room_summary.g.dart";
|
||||
|
||||
@Freezed(toJson: false, fromJson: false)
|
||||
@JsonSerializable()
|
||||
class const GetRoomSummary({
|
||||
required final String roomIdOrAlias,
|
||||
final IList<String> via = const IList.empty(),
|
||||
}) with _$GetRoomSummary {
|
||||
Map<String, Object?> toJson() => _$GetRoomSummaryToJson(this);
|
||||
|
||||
factory GetRoomSummary.fromJson(Map<String, Object?> json) =>
|
||||
_$GetRoomSummaryFromJson(json);
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@ part "join_room.g.dart";
|
|||
class const JoinRoomRequest({
|
||||
required final String roomIdOrAlias,
|
||||
final IList<String> via = const IList.empty(),
|
||||
final bool fromInvite = false,
|
||||
}) with _$JoinRoomRequest {
|
||||
Map<String, Object?> toJson() => _$JoinRoomRequestToJson(this);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:freezed_annotation/freezed_annotation.dart";
|
||||
import "package:nexus/models/invited_room.dart";
|
||||
import "package:nexus/models/room.dart";
|
||||
import "package:nexus/models/space_edge.dart";
|
||||
|
||||
|
|
@ -12,6 +13,7 @@ class const SyncData({
|
|||
final bool clearState = false,
|
||||
final IMap<String, IMap<String, dynamic>> accountData = const IMap.empty(),
|
||||
final IMap<String, Room> rooms = const IMap.empty(),
|
||||
final IList<InvitedRoom> invitedRooms = const IList.empty(),
|
||||
final ISet<String> leftRooms = const ISet.empty(),
|
||||
final IMap<String, IList<SpaceEdge>>? spaceEdges,
|
||||
final IList<String>? topLevelSpaces,
|
||||
|
|
|
|||
Loading…
Reference in a new issue