about summary refs log tree commit diff
path: root/Utilities/LibMatrix.HomeserverEmulator/Extensions/EventExtensions.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-11-14 10:48:26 +0100
committerRory& <root@rory.gay>2025-11-14 10:48:26 +0100
commit3558ba25896876b0c546f4c2decbb0671187745b (patch)
tree4e1a21a109726bbd7768e8a63b36f720c36f97f9 /Utilities/LibMatrix.HomeserverEmulator/Extensions/EventExtensions.cs
parentHandle some non-browser network errors, clean up some well known resolver stuff (diff)
downloadLibMatrix-3558ba25896876b0c546f4c2decbb0671187745b.tar.xz
StateEvent -> MatrixEvent
Diffstat (limited to 'Utilities/LibMatrix.HomeserverEmulator/Extensions/EventExtensions.cs')
-rw-r--r--Utilities/LibMatrix.HomeserverEmulator/Extensions/EventExtensions.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/Utilities/LibMatrix.HomeserverEmulator/Extensions/EventExtensions.cs b/Utilities/LibMatrix.HomeserverEmulator/Extensions/EventExtensions.cs

index d938b1b..15e41d4 100644 --- a/Utilities/LibMatrix.HomeserverEmulator/Extensions/EventExtensions.cs +++ b/Utilities/LibMatrix.HomeserverEmulator/Extensions/EventExtensions.cs
@@ -3,8 +3,8 @@ using LibMatrix.HomeserverEmulator.Services; namespace LibMatrix.HomeserverEmulator.Extensions; public static class EventExtensions { - public static StateEventResponse ToStateEvent(this StateEvent stateEvent, UserStore.User user, RoomStore.Room room) { - return new StateEventResponse { + public static MatrixEventResponse ToStateEvent(this StateEvent stateEvent, UserStore.User user, RoomStore.Room room) { + return new MatrixEventResponse { RawContent = stateEvent.RawContent, EventId = "$" + string.Join("", Random.Shared.GetItems("abcdefghijklmnopqrstuvwxyzABCDEFGHIJLKMNOPQRSTUVWXYZ0123456789".ToCharArray(), 100)), RoomId = room.RoomId, @@ -15,7 +15,7 @@ public static class EventExtensions { }; } - public static List<StateEventResponse> GetCalculatedState(this IEnumerable<StateEventResponse> events) { + public static List<MatrixEventResponse> GetCalculatedState(this IEnumerable<MatrixEventResponse> events) { return events.Where(s => s.StateKey != null) .OrderByDescending(s => s.OriginServerTs) .DistinctBy(x => (x.Type, x.StateKey))