From ae18c049338dfcb33f721eeeb0a05571e8bd87a9 Mon Sep 17 00:00:00 2001 From: Rory& Date: Thu, 30 May 2024 08:02:40 +0000 Subject: Rename StateEvent to LegacyMatrixEvent --- LibMatrix/Helpers/SyncStateResolver.cs | 42 +++++++++++++++++----------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'LibMatrix/Helpers/SyncStateResolver.cs') diff --git a/LibMatrix/Helpers/SyncStateResolver.cs b/LibMatrix/Helpers/SyncStateResolver.cs index 72d600d..b1f83ff 100644 --- a/LibMatrix/Helpers/SyncStateResolver.cs +++ b/LibMatrix/Helpers/SyncStateResolver.cs @@ -37,13 +37,13 @@ public class SyncStateResolver(AuthenticatedHomeserverGeneric homeserver, ILogge oldState.NextBatch = newState.NextBatch ?? oldState.NextBatch; oldState.AccountData ??= new EventList(); - oldState.AccountData.Events ??= new List(); + oldState.AccountData.Events ??= new List(); if (newState.AccountData?.Events is not null) - oldState.AccountData.Events.MergeStateEventLists(newState.AccountData?.Events ?? new List()); + oldState.AccountData.Events.MergeStateEventLists(newState.AccountData?.Events ?? new List()); oldState.Presence ??= new SyncResponse.PresenceDataStructure(); if (newState.Presence?.Events is not null) - oldState.Presence.Events.MergeStateEventLists(newState.Presence?.Events ?? new List()); + oldState.Presence.Events.MergeStateEventLists(newState.Presence?.Events ?? new List()); oldState.DeviceOneTimeKeysCount ??= new Dictionary(); if (newState.DeviceOneTimeKeysCount is not null) @@ -55,9 +55,9 @@ public class SyncStateResolver(AuthenticatedHomeserverGeneric homeserver, ILogge oldState.Rooms = MergeRoomsDataStructure(oldState.Rooms, newState.Rooms); oldState.ToDevice ??= new EventList(); - oldState.ToDevice.Events ??= new List(); + oldState.ToDevice.Events ??= new List(); if (newState.ToDevice?.Events is not null) - oldState.ToDevice.Events.MergeStateEventLists(newState.ToDevice?.Events ?? new List()); + oldState.ToDevice.Events.MergeStateEventLists(newState.ToDevice?.Events ?? new List()); oldState.DeviceLists ??= new SyncResponse.DeviceListsDataStructure(); if (newState.DeviceLists?.Changed is not null) @@ -97,22 +97,22 @@ public class SyncStateResolver(AuthenticatedHomeserverGeneric homeserver, ILogge private SyncResponse.RoomsDataStructure.LeftRoomDataStructure MergeLeftRoomDataStructure(SyncResponse.RoomsDataStructure.LeftRoomDataStructure oldData, SyncResponse.RoomsDataStructure.LeftRoomDataStructure newData) { oldData.AccountData ??= new EventList(); - oldData.AccountData.Events ??= new List(); + oldData.AccountData.Events ??= new List(); oldData.Timeline ??= new SyncResponse.RoomsDataStructure.JoinedRoomDataStructure.TimelineDataStructure(); - oldData.Timeline.Events ??= new List(); + oldData.Timeline.Events ??= new List(); oldData.State ??= new EventList(); - oldData.State.Events ??= new List(); + oldData.State.Events ??= new List(); if (newData.AccountData?.Events is not null) - oldData.AccountData.Events.MergeStateEventLists(newData.AccountData?.Events ?? new List()); + oldData.AccountData.Events.MergeStateEventLists(newData.AccountData?.Events ?? new List()); if (newData.Timeline?.Events is not null) - oldData.Timeline.Events.MergeStateEventLists(newData.Timeline?.Events ?? new List()); + oldData.Timeline.Events.MergeStateEventLists(newData.Timeline?.Events ?? new List()); oldData.Timeline.Limited = newData.Timeline?.Limited ?? oldData.Timeline.Limited; oldData.Timeline.PrevBatch = newData.Timeline?.PrevBatch ?? oldData.Timeline.PrevBatch; if (newData.State?.Events is not null) - oldData.State.Events.MergeStateEventLists(newData.State?.Events ?? new List()); + oldData.State.Events.MergeStateEventLists(newData.State?.Events ?? new List()); return oldData; } @@ -120,9 +120,9 @@ public class SyncStateResolver(AuthenticatedHomeserverGeneric homeserver, ILogge private SyncResponse.RoomsDataStructure.InvitedRoomDataStructure MergeInvitedRoomDataStructure(SyncResponse.RoomsDataStructure.InvitedRoomDataStructure oldData, SyncResponse.RoomsDataStructure.InvitedRoomDataStructure newData) { oldData.InviteState ??= new EventList(); - oldData.InviteState.Events ??= new List(); + oldData.InviteState.Events ??= new List(); if (newData.InviteState?.Events is not null) - oldData.InviteState.Events.MergeStateEventLists(newData.InviteState?.Events ?? new List()); + oldData.InviteState.Events.MergeStateEventLists(newData.InviteState?.Events ?? new List()); return oldData; } @@ -130,27 +130,27 @@ public class SyncStateResolver(AuthenticatedHomeserverGeneric homeserver, ILogge private SyncResponse.RoomsDataStructure.JoinedRoomDataStructure MergeJoinedRoomDataStructure(SyncResponse.RoomsDataStructure.JoinedRoomDataStructure oldData, SyncResponse.RoomsDataStructure.JoinedRoomDataStructure newData) { oldData.AccountData ??= new EventList(); - oldData.AccountData.Events ??= new List(); + oldData.AccountData.Events ??= new List(); oldData.Timeline ??= new SyncResponse.RoomsDataStructure.JoinedRoomDataStructure.TimelineDataStructure(); - oldData.Timeline.Events ??= new List(); + oldData.Timeline.Events ??= new List(); oldData.State ??= new EventList(); - oldData.State.Events ??= new List(); + oldData.State.Events ??= new List(); oldData.Ephemeral ??= new EventList(); - oldData.Ephemeral.Events ??= new List(); + oldData.Ephemeral.Events ??= new List(); if (newData.AccountData?.Events is not null) - oldData.AccountData.Events.MergeStateEventLists(newData.AccountData?.Events ?? new List()); + oldData.AccountData.Events.MergeStateEventLists(newData.AccountData?.Events ?? new List()); if (newData.Timeline?.Events is not null) - oldData.Timeline.Events.MergeStateEventLists(newData.Timeline?.Events ?? new List()); + oldData.Timeline.Events.MergeStateEventLists(newData.Timeline?.Events ?? new List()); oldData.Timeline.Limited = newData.Timeline?.Limited ?? oldData.Timeline.Limited; oldData.Timeline.PrevBatch = newData.Timeline?.PrevBatch ?? oldData.Timeline.PrevBatch; if (newData.State?.Events is not null) - oldData.State.Events.MergeStateEventLists(newData.State?.Events ?? new List()); + oldData.State.Events.MergeStateEventLists(newData.State?.Events ?? new List()); if (newData.Ephemeral?.Events is not null) - oldData.Ephemeral.Events.MergeStateEventLists(newData.Ephemeral?.Events ?? new List()); + oldData.Ephemeral.Events.MergeStateEventLists(newData.Ephemeral?.Events ?? new List()); oldData.UnreadNotifications ??= new SyncResponse.RoomsDataStructure.JoinedRoomDataStructure.UnreadNotificationsDataStructure(); oldData.UnreadNotifications.HighlightCount = newData.UnreadNotifications?.HighlightCount ?? oldData.UnreadNotifications.HighlightCount; -- cgit 1.4.1