about summary refs log tree commit diff
path: root/LibMatrix/StateEvent.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-05-09 17:28:08 +0200
committerRory& <root@rory.gay>2025-05-09 17:28:23 +0200
commita2b318f6f52dfec7f217643273e5b4e0855fe9e0 (patch)
tree4763c3916027aabcc688962a6213d0af891e0b84 /LibMatrix/StateEvent.cs
parentmsc4222 fixes (diff)
downloadLibMatrix-a2b318f6f52dfec7f217643273e5b4e0855fe9e0.tar.xz
WIP: reword me later HEAD master
Diffstat (limited to 'LibMatrix/StateEvent.cs')
-rw-r--r--LibMatrix/StateEvent.cs12
1 files changed, 6 insertions, 6 deletions
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 {