From 3558ba25896876b0c546f4c2decbb0671187745b Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 14 Nov 2025 10:48:26 +0100 Subject: StateEvent -> MatrixEvent --- LibMatrix/Responses/CreateRoomRequest.cs | 12 ++++++------ LibMatrix/Responses/MessagesResponse.cs | 4 ++-- LibMatrix/Responses/SyncResponse.cs | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'LibMatrix/Responses') diff --git a/LibMatrix/Responses/CreateRoomRequest.cs b/LibMatrix/Responses/CreateRoomRequest.cs index db7d004..b4dcc78 100644 --- a/LibMatrix/Responses/CreateRoomRequest.cs +++ b/LibMatrix/Responses/CreateRoomRequest.cs @@ -29,7 +29,7 @@ public class CreateRoomRequest { // public string Preset { get; set; } [JsonPropertyName("initial_state")] - public List? InitialState { get; set; } + public List? InitialState { get; set; } /// /// One of: ["public", "private"] @@ -54,15 +54,15 @@ public class CreateRoomRequest { /// For use only when you can't use the CreationContent property /// - public StateEvent? this[string eventType, string eventKey = ""] { + public MatrixEvent? this[string eventType, string eventKey = ""] { get { var stateEvent = InitialState?.FirstOrDefault(x => x.Type == eventType && x.StateKey == eventKey); if (stateEvent == null) - InitialState?.Add(stateEvent = new StateEvent { + InitialState?.Add(stateEvent = new MatrixEvent { Type = eventType, StateKey = eventKey, TypedContent = (EventContent)Activator.CreateInstance( - StateEvent.KnownStateEventTypes.FirstOrDefault(x => + MatrixEvent.KnownEventTypes.FirstOrDefault(x => x.GetCustomAttributes()? .Any(y => y.EventName == eventType) ?? false) ?? typeof(UnknownEventContent) )! @@ -122,7 +122,7 @@ public class CreateRoomRequest { } }, RoomAliasName = roomAliasName, - InitialState = new List() + InitialState = new List() }; return request; @@ -162,7 +162,7 @@ public class CreateRoomRequest { } }, RoomAliasName = roomAliasName, - InitialState = new List() + InitialState = new List() }; return request; diff --git a/LibMatrix/Responses/MessagesResponse.cs b/LibMatrix/Responses/MessagesResponse.cs index 4912add..1b412fe 100644 --- a/LibMatrix/Responses/MessagesResponse.cs +++ b/LibMatrix/Responses/MessagesResponse.cs @@ -10,8 +10,8 @@ public class MessagesResponse { public string? End { get; set; } [JsonPropertyName("chunk")] - public List Chunk { get; set; } = new(); + public List Chunk { get; set; } = new(); [JsonPropertyName("state")] - public List State { get; set; } = new(); + public List State { get; set; } = new(); } \ No newline at end of file diff --git a/LibMatrix/Responses/SyncResponse.cs b/LibMatrix/Responses/SyncResponse.cs index c2598ae..362ccc4 100644 --- a/LibMatrix/Responses/SyncResponse.cs +++ b/LibMatrix/Responses/SyncResponse.cs @@ -44,7 +44,7 @@ public class SyncResponse { // supporting classes public class PresenceDataStructure { [JsonPropertyName("events")] - public List? Events { get; set; } + public List? Events { get; set; } } public class RoomsDataStructure { @@ -116,13 +116,13 @@ public class SyncResponse { public class TimelineDataStructure : EventList { public TimelineDataStructure() { } - public TimelineDataStructure(List? events, bool? limited) { + public TimelineDataStructure(List? events, bool? limited) { Events = events; Limited = limited; } // [JsonPropertyName("events")] - // public List? Events { get; set; } + // public List? Events { get; set; } [JsonPropertyName("prev_batch")] public string? PrevBatch { get; set; } -- cgit 1.5.1