about summary refs log tree commit diff
path: root/LibMatrix/Responses/CreateRoomRequest.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 /LibMatrix/Responses/CreateRoomRequest.cs
parentHandle some non-browser network errors, clean up some well known resolver stuff (diff)
downloadLibMatrix-3558ba25896876b0c546f4c2decbb0671187745b.tar.xz
StateEvent -> MatrixEvent
Diffstat (limited to 'LibMatrix/Responses/CreateRoomRequest.cs')
-rw-r--r--LibMatrix/Responses/CreateRoomRequest.cs12
1 files changed, 6 insertions, 6 deletions
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<StateEvent>? InitialState { get; set; } + public List<MatrixEvent>? InitialState { get; set; } /// <summary> /// One of: ["public", "private"] @@ -54,15 +54,15 @@ public class CreateRoomRequest { /// For use only when you can't use the CreationContent property /// </summary> - 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<MatrixEventAttribute>()? .Any(y => y.EventName == eventType) ?? false) ?? typeof(UnknownEventContent) )! @@ -122,7 +122,7 @@ public class CreateRoomRequest { } }, RoomAliasName = roomAliasName, - InitialState = new List<StateEvent>() + InitialState = new List<MatrixEvent>() }; return request; @@ -162,7 +162,7 @@ public class CreateRoomRequest { } }, RoomAliasName = roomAliasName, - InitialState = new List<StateEvent>() + InitialState = new List<MatrixEvent>() }; return request;