about summary refs log tree commit diff
path: root/LibMatrix/StateEvent.cs
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-11-05 18:17:11 +0100
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-11-05 18:17:11 +0100
commit1d6399d7f4649472333da946669ce9f1fa349b89 (patch)
tree95baedad8e42956de6d4d339d5c4fdc44ae2396b /LibMatrix/StateEvent.cs
parentsplit client and server http client for homeservers (diff)
downloadLibMatrix-1d6399d7f4649472333da946669ce9f1fa349b89.tar.xz
Cleanup, fixes, fix proxy support
Diffstat (limited to 'LibMatrix/StateEvent.cs')
-rw-r--r--LibMatrix/StateEvent.cs12
1 files changed, 10 insertions, 2 deletions
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<StateEventResponse>? Events { get; set; } = new();