From 2f8a17fab9b13cbeb93f3d7b07b0bb51d17aa8b2 Mon Sep 17 00:00:00 2001 From: Rory& Date: Mon, 16 Jun 2025 06:43:44 +0200 Subject: Room builder, support managing room dir --- LibMatrix/StateEvent.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'LibMatrix/StateEvent.cs') diff --git a/LibMatrix/StateEvent.cs b/LibMatrix/StateEvent.cs index a1ca9dc..af25805 100644 --- a/LibMatrix/StateEvent.cs +++ b/LibMatrix/StateEvent.cs @@ -121,7 +121,16 @@ public class StateEvent { 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 && JsonNode.DeepEquals(x.RawContent, y.RawContent); + public static bool Equals(StateEventResponse x, StateEventResponse y) => x.Type == y.Type && x.StateKey == y.StateKey && x.EventId == y.EventId; + + /// + /// Compares two state events for deep equality, including type, state key, and raw content. + /// If you trust the server, use Equals instead, as that compares by event ID instead of raw content. + /// + /// + /// + /// + public static bool DeepEquals(StateEventResponse x, StateEventResponse y) => x.Type == y.Type && x.StateKey == y.StateKey && JsonNode.DeepEquals(x.RawContent, y.RawContent); } public class StateEventResponse : StateEvent { -- cgit 1.5.1