From 013f1693885a5de01ae357af2909589e925863d5 Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 22 Aug 2025 17:36:27 +0200 Subject: Bulk sending, policy interpreting improvements, room upgrade builder work --- LibMatrix/StateEvent.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'LibMatrix/StateEvent.cs') diff --git a/LibMatrix/StateEvent.cs b/LibMatrix/StateEvent.cs index aa755ef..8455098 100644 --- a/LibMatrix/StateEvent.cs +++ b/LibMatrix/StateEvent.cs @@ -123,7 +123,7 @@ public class StateEvent { 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.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. @@ -138,6 +138,12 @@ public class StateEventResponse : StateEvent { [JsonPropertyName("origin_server_ts")] public long? OriginServerTs { get; set; } + [JsonIgnore] + public DateTime? OriginServerTimestamp { + get => OriginServerTs.HasValue ? DateTimeOffset.FromUnixTimeMilliseconds(OriginServerTs.Value).UtcDateTime : DateTime.MinValue; + set => OriginServerTs = value is null ? null : new DateTimeOffset(value.Value).ToUnixTimeMilliseconds(); + } + [JsonPropertyName("room_id")] public string? RoomId { get; set; } -- cgit 1.5.1