about summary refs log tree commit diff
path: root/LibMatrix/Responses
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-09-15 09:50:45 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-09-15 09:50:45 +0200
commit6bd02248ccfbcb46960a6f39eaad23888d190eb5 (patch)
tree110578f31b6f9f70a7a1edab32fb3a34d6ad4f1a /LibMatrix/Responses
parentMedia moderator PoC works, abstract command handling to library (diff)
downloadLibMatrix-6bd02248ccfbcb46960a6f39eaad23888d190eb5.tar.xz
Some refactoring
Diffstat (limited to 'LibMatrix/Responses')
-rw-r--r--LibMatrix/Responses/CreateRoomRequest.cs5
1 files changed, 3 insertions, 2 deletions
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<MatrixEventAttribute>()?
                                 .Any(y => y.EventName == event_type) ?? false) ?? typeof(object)