From e10fa389ce3c4d42deadfec8bf08c2fbb1a88d79 Mon Sep 17 00:00:00 2001 From: "Emma@Rory&" Date: Fri, 15 Sep 2023 09:55:36 +0200 Subject: Refactors --- .../DefaultRoomCreationTemplate.cs | 27 +++++++++++----------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs') diff --git a/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs b/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs index bb2eab9..3f67f33 100644 --- a/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs +++ b/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs @@ -2,7 +2,6 @@ using System.Text.Json.Nodes; using LibMatrix; using LibMatrix.Responses; using LibMatrix.StateEventTypes.Spec; -using LibMatrix.StateEventTypes; namespace MatrixRoomUtils.Web.Classes.RoomCreationTemplates; @@ -16,39 +15,39 @@ public class DefaultRoomCreationTemplate : IRoomCreationTemplate { InitialState = new List { new() { Type = "m.room.history_visibility", - TypedContent = new { - history_visibility = "world_readable" + TypedContent = new HistoryVisibilityEventContent() { + HistoryVisibility = "world_readable" } }, new() { Type = "m.room.guest_access", - TypedContent = new GuestAccessEventData { + TypedContent = new GuestAccessEventContent { GuestAccess = "can_join" } }, new() { Type = "m.room.join_rules", - TypedContent = new JoinRulesEventData { + TypedContent = new JoinRulesEventContent { JoinRule = "public" } }, new() { Type = "m.room.server_acl", - TypedContent = new { - allow = new[] { "*" }, - deny = Array.Empty(), - allow_ip_literals = false + TypedContent = new ServerACLEventContent() { + Allow = new List() { "*" }, + Deny = new List(), + AllowIpLiterals = false } }, new() { Type = "m.room.avatar", - TypedContent = new RoomAvatarEventData { + TypedContent = new RoomAvatarEventContent { Url = "mxc://feline.support/UKNhEyrVsrAbYteVvZloZcFj" } } }, Visibility = "public", - PowerLevelContentOverride = new RoomPowerLevelEventData { + PowerLevelContentOverride = new RoomPowerLevelEventContent { UsersDefault = 0, EventsDefault = 100, StateDefault = 50, @@ -56,10 +55,10 @@ public class DefaultRoomCreationTemplate : IRoomCreationTemplate { Redact = 50, Kick = 50, Ban = 50, - NotificationsPl = new RoomPowerLevelEventData.NotificationsPL { + NotificationsPl = new RoomPowerLevelEventContent.NotificationsPL { Room = 50 }, - Events = new Dictionary { + Events = new() { { "im.vector.modular.widgets", 50 }, { "io.element.voice_broadcast_info", 50 }, { "m.reaction", 100 }, @@ -78,7 +77,7 @@ public class DefaultRoomCreationTemplate : IRoomCreationTemplate { { "org.matrix.msc3401.call", 50 }, { "org.matrix.msc3401.call.member", 50 } }, - Users = new Dictionary { + Users = new() { // { RuntimeCache.CurrentHomeServer.UserId, 100 } //TODO: re-implement this } -- cgit 1.4.1