about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--LibMatrix/Responses/SyncResponse.cs2
-rw-r--r--LibMatrix/StateEvent.cs12
2 files changed, 7 insertions, 7 deletions
diff --git a/LibMatrix/Responses/SyncResponse.cs b/LibMatrix/Responses/SyncResponse.cs

index 47fb753..d79e820 100644 --- a/LibMatrix/Responses/SyncResponse.cs +++ b/LibMatrix/Responses/SyncResponse.cs
@@ -167,7 +167,7 @@ public class SyncResponse { ]).Max(); } - [JsonConverter(typeof(JsonStringEnumConverter))] + [JsonConverter(typeof(JsonStringEnumConverter<Msc4222SyncType>))] public enum Msc4222SyncType { None, Server, diff --git a/LibMatrix/StateEvent.cs b/LibMatrix/StateEvent.cs
index ef760e1..e2ac87e 100644 --- a/LibMatrix/StateEvent.cs +++ b/LibMatrix/StateEvent.cs
@@ -100,13 +100,10 @@ public class StateEvent { [JsonPropertyName("replaces_state")] public string? ReplacesState { get; set; } - private JsonObject? _rawContent; - [JsonPropertyName("content")] - public JsonObject? RawContent { - get => _rawContent; - set => _rawContent = value; - } + // [field: AllowNull, MaybeNull] + [NotNull] + public JsonObject? RawContent { get; set; } //debug [JsonIgnore] @@ -122,6 +119,9 @@ public class StateEvent { [JsonIgnore] public string InternalContentTypeName => TypedContent?.GetType().Name ?? "null"; + + public static bool TypeKeyPairMatches(StateEventResponse x, StateEventResponse y) => x.Type == y.Type && x.StateKey == y.StateKey; + public static bool Equals(StateEventResponse x, StateEventResponse y) => x.Type == y.Type && x.StateKey == y.StateKey && x.RawContent.Equals(y.RawContent); } public class StateEventResponse : StateEvent {