From bcd408ce15dc5f364de48517f6d6f499405078de Mon Sep 17 00:00:00 2001 From: Rory& Date: Thu, 8 May 2025 23:02:05 +0200 Subject: Retry http requests up to 5 times, add support for unstable state_after --- LibMatrix/Responses/SyncResponse.cs | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'LibMatrix/Responses') diff --git a/LibMatrix/Responses/SyncResponse.cs b/LibMatrix/Responses/SyncResponse.cs index a7aebda..47fb753 100644 --- a/LibMatrix/Responses/SyncResponse.cs +++ b/LibMatrix/Responses/SyncResponse.cs @@ -28,7 +28,7 @@ public class SyncResponse { [JsonPropertyName("device_lists")] public DeviceListsDataStructure? DeviceLists { get; set; } - + [JsonPropertyName("gay.rory.libmatrix.msc4222_sync_type")] public Msc4222SyncType Msc4222Method { get; set; } = Msc4222SyncType.None; @@ -65,10 +65,16 @@ public class SyncResponse { [JsonPropertyName("state")] public EventList? State { get; set; } - + [JsonPropertyName("state_after")] public EventList? StateAfter { get; set; } + [Obsolete("This property is only used for de/serialisation")] + [JsonPropertyName("org.matrix.msc4222.state_after")] + public EventList? StateAfterUnstable { + get => StateAfter; + set => StateAfter = value; + } public override string ToString() { var lastEvent = Timeline?.Events?.LastOrDefault(x => x.Type == "m.room.member"); @@ -83,10 +89,17 @@ public class SyncResponse { [JsonPropertyName("state")] public EventList? State { get; set; } - + [JsonPropertyName("state_after")] public EventList? StateAfter { get; set; } + [Obsolete("This property is only used for de/serialisation")] + [JsonPropertyName("org.matrix.msc4222.state_after")] + public EventList? StateAfterUnstable { + get => StateAfter; + set => StateAfter = value; + } + [JsonPropertyName("account_data")] public EventList? AccountData { get; set; } @@ -153,11 +166,11 @@ public class SyncResponse { Rooms?.Leave?.Values?.Max(x => x.Timeline?.Events?.Max(y => y.OriginServerTs)) ?? 0 ]).Max(); } - + [JsonConverter(typeof(JsonStringEnumConverter))] public enum Msc4222SyncType { None, Server, Emulated } -} +} \ No newline at end of file -- cgit 1.5.1