diff --git a/LibMatrix/Helpers/RoomBuilder.cs b/LibMatrix/Helpers/RoomBuilder.cs
index 6e24103..a292f33 100644
--- a/LibMatrix/Helpers/RoomBuilder.cs
+++ b/LibMatrix/Helpers/RoomBuilder.cs
@@ -44,12 +44,12 @@ public class RoomBuilder {
/// <summary>
/// State events to be sent *before* room access is configured. Keep this small!
/// </summary>
- public List<StateEvent> ImportantState { get; set; } = [];
+ public List<MatrixEvent> ImportantState { get; set; } = [];
/// <summary>
/// State events to be sent *after* room access is configured, but before invites are sent.
/// </summary>
- public List<StateEvent> InitialState { get; set; } = [];
+ public List<MatrixEvent> InitialState { get; set; } = [];
/// <summary>
/// Users to invite, with optional reason
@@ -86,7 +86,7 @@ public class RoomBuilder {
{ RoomPolicyServerEventContent.EventId, 100 },
{ RoomPinnedEventContent.EventId, 50 },
// recommended extensions
- { "im.vector.modular.widgets", 50},
+ { "im.vector.modular.widgets", 50 },
// { "m.reaction", 0 }, // we probably don't want these to end up as room state
// - prevent calls
{ "io.element.voice_broadcast_info", 50 },
@@ -197,7 +197,7 @@ public class RoomBuilder {
await Task.WhenAll(inviteTasks);
}
- private async Task SetStatesAsync(GenericRoom room, List<StateEvent> state) {
+ private async Task SetStatesAsync(GenericRoom room, List<MatrixEvent> state) {
if (state.Count == 0) return;
await room.BulkSendEventsAsync(state);
// We chunk this up to try to avoid hitting reverse proxy timeouts
diff --git a/LibMatrix/Helpers/RoomUpgradeBuilder.cs b/LibMatrix/Helpers/RoomUpgradeBuilder.cs
index 85a5e36..ced0ef3 100644
--- a/LibMatrix/Helpers/RoomUpgradeBuilder.cs
+++ b/LibMatrix/Helpers/RoomUpgradeBuilder.cs
@@ -107,7 +107,7 @@ public class RoomUpgradeBuilder : RoomBuilder {
Console.WriteLine($"Imported {total} state events from old room {OldRoom.RoomId} in {sw.ElapsedMilliseconds}ms");
}
- private StateEventResponse UpgradeUnstableValues(StateEventResponse evt) {
+ private MatrixEventResponse UpgradeUnstableValues(MatrixEventResponse evt) {
if (evt.IsLegacyType) {
var oldType = evt.Type;
evt.Type = evt.MappedType.GetCustomAttributes<MatrixEventAttribute>().FirstOrDefault(x => !x.Legacy)!.EventName;
@@ -124,7 +124,7 @@ public class RoomUpgradeBuilder : RoomBuilder {
return evt;
}
- private void ImportPolicyEventAsync(StateEventResponse evt) {
+ private void ImportPolicyEventAsync(MatrixEventResponse evt) {
var msc4321Options = UpgradeOptions.Msc4321PolicyListUpgradeOptions;
if (msc4321Options is { Enable: true, UpgradeType: Msc4321PolicyListUpgradeOptions.Msc4321PolicyListUpgradeType.Transition })
return; // this upgrade type doesnt copy policies
diff --git a/LibMatrix/Helpers/SyncHelper.cs b/LibMatrix/Helpers/SyncHelper.cs
index c8e2928..ebe653c 100644
--- a/LibMatrix/Helpers/SyncHelper.cs
+++ b/LibMatrix/Helpers/SyncHelper.cs
@@ -298,9 +298,9 @@ public class SyncHelper(AuthenticatedHomeserverGeneric homeserver, ILogger? logg
if (syncResponse.Rooms is { Join.Count: > 0 })
foreach (var updatedRoom in syncResponse.Rooms.Join) {
if (updatedRoom.Value.Timeline is null) continue;
- foreach (var stateEventResponse in updatedRoom.Value.Timeline.Events ?? []) {
- stateEventResponse.RoomId = updatedRoom.Key;
- var tasks = TimelineEventHandlers.Select(x => x(stateEventResponse)).ToList();
+ foreach (var MatrixEventResponse in updatedRoom.Value.Timeline.Events ?? []) {
+ MatrixEventResponse.RoomId = updatedRoom.Key;
+ var tasks = TimelineEventHandlers.Select(x => x(MatrixEventResponse)).ToList();
await Task.WhenAll(tasks);
}
}
@@ -319,12 +319,12 @@ public class SyncHelper(AuthenticatedHomeserverGeneric homeserver, ILogger? logg
/// <summary>
/// Event fired when a timeline event is received
/// </summary>
- public List<Func<StateEventResponse, Task>> TimelineEventHandlers { get; } = new();
+ public List<Func<MatrixEventResponse, Task>> TimelineEventHandlers { get; } = new();
/// <summary>
/// Event fired when an account data event is received
/// </summary>
- public List<Func<StateEventResponse, Task>> AccountDataReceivedHandlers { get; } = new();
+ public List<Func<MatrixEventResponse, Task>> AccountDataReceivedHandlers { get; } = new();
/// <summary>
/// Event fired when an exception is thrown
diff --git a/LibMatrix/Helpers/SyncProcessors/Msc4222EmulationSyncProcessor.cs b/LibMatrix/Helpers/SyncProcessors/Msc4222EmulationSyncProcessor.cs
index be8aa8d..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;
}
@@ -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);
}
@@ -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);
}
diff --git a/LibMatrix/Helpers/SyncStateResolver.cs b/LibMatrix/Helpers/SyncStateResolver.cs
index f111c79..17c1a41 100644
--- a/LibMatrix/Helpers/SyncStateResolver.cs
+++ b/LibMatrix/Helpers/SyncStateResolver.cs
@@ -625,7 +625,7 @@ public class SyncStateResolver(AuthenticatedHomeserverGeneric homeserver, ILogge
return oldState;
}
- private static EventList? MergeEventListBy(EventList? oldState, EventList? newState, Func<StateEventResponse, StateEventResponse, bool> comparer) {
+ private static EventList? MergeEventListBy(EventList? oldState, EventList? newState, Func<MatrixEventResponse, MatrixEventResponse, bool> comparer) {
if (newState is null) return oldState;
if (oldState is null) {
return newState;
|