about summary refs log tree commit diff
path: root/LibMatrix/StateEvent.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-08-22 17:36:27 +0200
committerRory& <root@rory.gay>2025-08-22 17:36:27 +0200
commit013f1693885a5de01ae357af2909589e925863d5 (patch)
treeb506dfd0eacdd1e25159141478b643e4da04ab38 /LibMatrix/StateEvent.cs
parentSome cleanup, further room builder work (diff)
downloadLibMatrix-013f1693885a5de01ae357af2909589e925863d5.tar.xz
Bulk sending, policy interpreting improvements, room upgrade builder work
Diffstat (limited to 'LibMatrix/StateEvent.cs')
-rw-r--r--LibMatrix/StateEvent.cs8
1 files changed, 7 insertions, 1 deletions
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; - + /// <summary> /// 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; }