From 1d6399d7f4649472333da946669ce9f1fa349b89 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sun, 5 Nov 2023 18:17:11 +0100 Subject: Cleanup, fixes, fix proxy support --- LibMatrix/StateEvent.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'LibMatrix/StateEvent.cs') diff --git a/LibMatrix/StateEvent.cs b/LibMatrix/StateEvent.cs index dbb3401..3e8c4b5 100644 --- a/LibMatrix/StateEvent.cs +++ b/LibMatrix/StateEvent.cs @@ -36,6 +36,7 @@ public class StateEvent { return eventType ?? typeof(UnknownEventContent); } + [JsonIgnore] public EventContent TypedContent { get { if(Type == "m.receipt") { @@ -134,6 +135,7 @@ public class StateEvent { public string cdtype => TypedContent.GetType().Name; } + public class StateEventResponse : StateEvent { [JsonPropertyName("origin_server_ts")] public ulong OriginServerTs { get; set; } @@ -150,8 +152,8 @@ public class StateEventResponse : StateEvent { [JsonPropertyName("event_id")] public string EventId { get; set; } - [JsonPropertyName("user_id")] - public string UserId { get; set; } + // [JsonPropertyName("user_id")] + // public string UserId { get; set; } [JsonPropertyName("replaces_state")] public new string ReplacesState { get; set; } @@ -177,6 +179,12 @@ public class StateEventResponse : StateEvent { } } +[JsonSourceGenerationOptions(WriteIndented = true)] +[JsonSerializable(typeof(ChunkedStateEventResponse))] +internal partial class ChunkedStateEventResponseSerializerContext : JsonSerializerContext +{ +} + public class EventList { [JsonPropertyName("events")] public List? Events { get; set; } = new(); -- cgit 1.4.1