From 6bd02248ccfbcb46960a6f39eaad23888d190eb5 Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Fri, 15 Sep 2023 09:50:45 +0200 Subject: Some refactoring --- LibMatrix/Responses/CreateRoomRequest.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'LibMatrix/Responses') diff --git a/LibMatrix/Responses/CreateRoomRequest.cs b/LibMatrix/Responses/CreateRoomRequest.cs index 24c9ae0..82a4b12 100644 --- a/LibMatrix/Responses/CreateRoomRequest.cs +++ b/LibMatrix/Responses/CreateRoomRequest.cs @@ -4,6 +4,7 @@ using System.Text.Json.Serialization; using System.Text.RegularExpressions; using LibMatrix.Helpers; using LibMatrix.Homeservers; +using LibMatrix.Interfaces; using LibMatrix.StateEventTypes.Spec; namespace LibMatrix.Responses; @@ -33,7 +34,7 @@ public class CreateRoomRequest { public string Visibility { get; set; } = null!; [JsonPropertyName("power_level_content_override")] - public RoomPowerLevelEventData PowerLevelContentOverride { get; set; } = null!; + public RoomPowerLevelEventContent PowerLevelContentOverride { get; set; } = null!; [JsonPropertyName("creation_content")] public JsonObject CreationContent { get; set; } = new(); @@ -52,7 +53,7 @@ public class CreateRoomRequest { InitialState.Add(stateEvent = new StateEvent { Type = event_type, StateKey = event_key, - TypedContent = Activator.CreateInstance( + TypedContent = (EventContent)Activator.CreateInstance( StateEvent.KnownStateEventTypes.FirstOrDefault(x => x.GetCustomAttributes()? .Any(y => y.EventName == event_type) ?? false) ?? typeof(object) -- cgit 1.4.1