about summary refs log tree commit diff
path: root/LibMatrix/Helpers/SyncProcessors/Msc4222EmulationSyncProcessor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'LibMatrix/Helpers/SyncProcessors/Msc4222EmulationSyncProcessor.cs')
-rw-r--r--LibMatrix/Helpers/SyncProcessors/Msc4222EmulationSyncProcessor.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/LibMatrix/Helpers/SyncProcessors/Msc4222EmulationSyncProcessor.cs b/LibMatrix/Helpers/SyncProcessors/Msc4222EmulationSyncProcessor.cs

index e34b5cf..c887f6e 100644 --- a/LibMatrix/Helpers/SyncProcessors/Msc4222EmulationSyncProcessor.cs +++ b/LibMatrix/Helpers/SyncProcessors/Msc4222EmulationSyncProcessor.cs
@@ -8,11 +8,11 @@ using Microsoft.Extensions.Logging; namespace LibMatrix.Helpers.SyncProcessors; public class Msc4222EmulationSyncProcessor(AuthenticatedHomeserverGeneric homeserver, ILogger? logger) { - private static bool StateEventsMatch(StateEventResponse a, StateEventResponse b) { + private static bool StateEventsMatch(MatrixEventResponse a, MatrixEventResponse b) { return a.Type == b.Type && a.StateKey == b.StateKey; } - private static bool StateEventIsNewer(StateEventResponse a, StateEventResponse b) { + private static bool StateEventIsNewer(MatrixEventResponse a, MatrixEventResponse b) { return StateEventsMatch(a, b) && a.OriginServerTs < b.OriginServerTs; } @@ -45,7 +45,7 @@ public class Msc4222EmulationSyncProcessor(AuthenticatedHomeserverGeneric homese tasks.AddRange(resp.Rooms.Leave.Select(ProcessLeftRooms).ToList()); } - var tasksEnum = tasks.ToAsyncEnumerable(); + var tasksEnum = tasks.ToAsyncResultEnumerable(); await foreach (var wasModified in tasksEnum) { if (wasModified) { modified = true; @@ -76,7 +76,7 @@ public class Msc4222EmulationSyncProcessor(AuthenticatedHomeserverGeneric homese Events = [] }; - var oldState = new List<StateEventResponse>(); + var oldState = new List<MatrixEventResponse>(); if (data.State is { Events.Count: > 0 }) { oldState.ReplaceBy(data.State.Events, StateEventIsNewer); } @@ -129,7 +129,7 @@ public class Msc4222EmulationSyncProcessor(AuthenticatedHomeserverGeneric homese } }); - var tasksEnum = tasks.ToAsyncEnumerable(); + var tasksEnum = tasks.ToAsyncResultEnumerable(); await foreach (var evt in tasksEnum) { data.StateAfter.Events.Add(evt); } @@ -160,7 +160,7 @@ public class Msc4222EmulationSyncProcessor(AuthenticatedHomeserverGeneric homese logger?.LogWarning("Msc4222Emulation: Failed to get full state for room {roomId}, state may be incomplete!\n{exception}", roomId, e); } - var oldState = new List<StateEventResponse>(); + var oldState = new List<MatrixEventResponse>(); if (data.State is { Events.Count: > 0 }) { oldState.ReplaceBy(data.State.Events, StateEventIsNewer); } @@ -198,7 +198,7 @@ public class Msc4222EmulationSyncProcessor(AuthenticatedHomeserverGeneric homese } }); - var tasksEnum = tasks.ToAsyncEnumerable(); + var tasksEnum = tasks.ToAsyncResultEnumerable(); await foreach (var evt in tasksEnum) { data.StateAfter.Events.Add(evt); }