From 61a7cfd43928f7473537ea59f87a5eb28c8dbd84 Mon Sep 17 00:00:00 2001 From: Rory& Date: Wed, 23 Jul 2025 09:04:17 +0200 Subject: Remove some pointless null checks in SyncResponse, add missing const for room history visibility --- .../Spec/State/RoomInfo/RoomHistoryVisibilityEventContent.cs | 1 + LibMatrix/Responses/SyncResponse.cs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomHistoryVisibilityEventContent.cs b/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomHistoryVisibilityEventContent.cs index 8edf4a7..3b3ba34 100644 --- a/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomHistoryVisibilityEventContent.cs +++ b/LibMatrix.EventTypes/Spec/State/RoomInfo/RoomHistoryVisibilityEventContent.cs @@ -13,5 +13,6 @@ public class RoomHistoryVisibilityEventContent : EventContent { public const string WorldReadable = "world_readable"; public const string Invited = "invited"; public const string Shared = "shared"; + public const string Joined = "joined"; } } \ No newline at end of file diff --git a/LibMatrix/Responses/SyncResponse.cs b/LibMatrix/Responses/SyncResponse.cs index 657d7e0..c2598ae 100644 --- a/LibMatrix/Responses/SyncResponse.cs +++ b/LibMatrix/Responses/SyncResponse.cs @@ -163,9 +163,9 @@ public class SyncResponse { AccountData?.Events?.Max(x => x.OriginServerTs) ?? 0, Presence?.Events?.Max(x => x.OriginServerTs) ?? 0, ToDevice?.Events?.Max(x => x.OriginServerTs) ?? 0, - Rooms?.Join?.Values?.Max(x => x.Timeline?.Events?.Max(y => y.OriginServerTs)) ?? 0, - Rooms?.Invite?.Values?.Max(x => x.InviteState?.Events?.Max(y => y.OriginServerTs)) ?? 0, - Rooms?.Leave?.Values?.Max(x => x.Timeline?.Events?.Max(y => y.OriginServerTs)) ?? 0 + Rooms?.Join?.Values.Max(x => x.Timeline?.Events?.Max(y => y.OriginServerTs)) ?? 0, + Rooms?.Invite?.Values.Max(x => x.InviteState?.Events?.Max(y => y.OriginServerTs)) ?? 0, + Rooms?.Leave?.Values.Max(x => x.Timeline?.Events?.Max(y => y.OriginServerTs)) ?? 0 ]).Max(); } -- cgit 1.5.1