about summary refs log tree commit diff
path: root/LibMatrix/Responses/CreateRoomRequest.cs
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2024-05-30 09:46:43 +0000
committerRory& <root@rory.gay>2024-05-30 09:46:43 +0000
commit30a0868789466012bab869af4300aef5a9cac108 (patch)
tree12790166e4d2c01a141928143b9b4d96dd08ace8 /LibMatrix/Responses/CreateRoomRequest.cs
parentClarify LegacyEvent types (diff)
downloadLibMatrix-30a0868789466012bab869af4300aef5a9cac108.tar.xz
Rename legacy event types
Diffstat (limited to '')
-rw-r--r--LibMatrix/Responses/CreateRoomRequest.cs16
1 files changed, 8 insertions, 8 deletions
diff --git a/LibMatrix/Responses/CreateRoomRequest.cs b/LibMatrix/Responses/CreateRoomRequest.cs
index 6919b84..cae2a04 100644
--- a/LibMatrix/Responses/CreateRoomRequest.cs
+++ b/LibMatrix/Responses/CreateRoomRequest.cs
@@ -38,7 +38,7 @@ public class CreateRoomRequest {
     public string? Visibility { get; set; }
 
     [JsonPropertyName("power_level_content_override")]
-    public RoomPowerLevelEventContent? PowerLevelContentOverride { get; set; } = null!;
+    public RoomPowerLevelLegacyEventContent? PowerLevelContentOverride { get; set; } = null!;
 
     [JsonPropertyName("creation_content")]
     public JsonObject CreationContent { get; set; } = new();
@@ -57,10 +57,10 @@ public class CreateRoomRequest {
                 InitialState.Add(stateEvent = new LegacyMatrixEvent {
                     Type = eventType,
                     StateKey = eventKey,
-                    TypedContent = (EventContent)Activator.CreateInstance(
+                    TypedContent = (LegacyEventContent)Activator.CreateInstance(
                         LegacyMatrixEvent.KnownStateEventTypes.FirstOrDefault(x =>
-                            x.GetCustomAttributes<MatrixEventAttribute>()?
-                                .Any(y => y.EventName == eventType) ?? false) ?? typeof(UnknownEventContent)
+                            x.GetCustomAttributes<LegacyMatrixEventAttribute>()?
+                                .Any(y => y.EventName == eventType) ?? false) ?? typeof(UnknownLegacyEventContent)
                     )!
                 });
 
@@ -89,7 +89,7 @@ public class CreateRoomRequest {
             Name = name ?? "New public Room",
             Visibility = "public",
             CreationContent = new JsonObject(),
-            PowerLevelContentOverride = new RoomPowerLevelEventContent {
+            PowerLevelContentOverride = new RoomPowerLevelLegacyEventContent {
                 EventsDefault = 0,
                 UsersDefault = 0,
                 Kick = 50,
@@ -97,7 +97,7 @@ public class CreateRoomRequest {
                 Invite = 25,
                 StateDefault = 10,
                 Redact = 50,
-                NotificationsPl = new RoomPowerLevelEventContent.NotificationsPL {
+                NotificationsPl = new RoomPowerLevelLegacyEventContent.NotificationsPL {
                     Room = 10
                 },
                 Events = new Dictionary<string, long> {
@@ -129,7 +129,7 @@ public class CreateRoomRequest {
             Name = name ?? "New private Room",
             Visibility = "private",
             CreationContent = new JsonObject(),
-            PowerLevelContentOverride = new RoomPowerLevelEventContent {
+            PowerLevelContentOverride = new RoomPowerLevelLegacyEventContent {
                 EventsDefault = 0,
                 UsersDefault = 0,
                 Kick = 50,
@@ -137,7 +137,7 @@ public class CreateRoomRequest {
                 Invite = 25,
                 StateDefault = 10,
                 Redact = 50,
-                NotificationsPl = new RoomPowerLevelEventContent.NotificationsPL {
+                NotificationsPl = new RoomPowerLevelLegacyEventContent.NotificationsPL {
                     Room = 10
                 },
                 Events = new Dictionary<string, long> {