From f41b6e5ec431c88bc1d94e4832d8ba49ddc42004 Mon Sep 17 00:00:00 2001 From: "Emma [it/its]@Rory&" Date: Tue, 5 Mar 2024 11:19:52 +0100 Subject: HomeserverEmulator work --- LibMatrix/Responses/CreateRoomRequest.cs | 6 ++++-- LibMatrix/Responses/RoomKeysResponse.cs | 19 +++++++++++++++++++ LibMatrix/Responses/SyncResponse.cs | 7 +++++++ 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 LibMatrix/Responses/RoomKeysResponse.cs (limited to 'LibMatrix/Responses') diff --git a/LibMatrix/Responses/CreateRoomRequest.cs b/LibMatrix/Responses/CreateRoomRequest.cs index d78f574..ee4317e 100644 --- a/LibMatrix/Responses/CreateRoomRequest.cs +++ b/LibMatrix/Responses/CreateRoomRequest.cs @@ -12,7 +12,9 @@ namespace LibMatrix.Responses; public class CreateRoomRequest { [JsonIgnore] public CreationContentBaseType CreationContentBaseType; - public CreateRoomRequest() => CreationContentBaseType = new CreationContentBaseType(this); + public CreateRoomRequest() { + CreationContentBaseType = new CreationContentBaseType(this); + } [JsonPropertyName("name")] public string? Name { get; set; } @@ -37,7 +39,7 @@ public class CreateRoomRequest { public string? Visibility { get; set; } [JsonPropertyName("power_level_content_override")] - public RoomPowerLevelEventContent PowerLevelContentOverride { get; set; } = null!; + public RoomPowerLevelEventContent? PowerLevelContentOverride { get; set; } = null!; [JsonPropertyName("creation_content")] public JsonObject CreationContent { get; set; } = new(); diff --git a/LibMatrix/Responses/RoomKeysResponse.cs b/LibMatrix/Responses/RoomKeysResponse.cs new file mode 100644 index 0000000..8dc305a --- /dev/null +++ b/LibMatrix/Responses/RoomKeysResponse.cs @@ -0,0 +1,19 @@ +using System.Text.Json.Nodes; +using System.Text.Json.Serialization; + +namespace LibMatrix.Responses; + +public class RoomKeysRequest { + [JsonPropertyName("algorithm")] + public string Algorithm { get; set; } + + [JsonPropertyName("auth_data")] + public JsonObject AuthData { get; set; } +} +public class RoomKeysResponse : RoomKeysRequest { + [JsonPropertyName("version")] + public string Version { get; set; } + + [JsonPropertyName("etag")] + public string Etag { get; set; } +} \ No newline at end of file diff --git a/LibMatrix/Responses/SyncResponse.cs b/LibMatrix/Responses/SyncResponse.cs index 49259d0..e4addb6 100644 --- a/LibMatrix/Responses/SyncResponse.cs +++ b/LibMatrix/Responses/SyncResponse.cs @@ -83,6 +83,13 @@ public class SyncResponse { public SummaryDataStructure? Summary { get; set; } public class TimelineDataStructure { + public TimelineDataStructure() { } + + public TimelineDataStructure(List? events, bool? limited) { + Events = events; + Limited = limited; + } + [JsonPropertyName("events")] public List? Events { get; set; } -- cgit 1.4.1