diff options
Diffstat (limited to 'MatrixRoomUtils.Web/Classes')
-rw-r--r-- | MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs | 4 | ||||
-rw-r--r-- | MatrixRoomUtils.Web/Classes/RoomInfo.cs | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs b/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs index a519977..f895173 100644 --- a/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs +++ b/MatrixRoomUtils.Web/Classes/RoomCreationTemplates/DefaultRoomCreationTemplate.cs @@ -48,7 +48,7 @@ public class DefaultRoomCreationTemplate : IRoomCreationTemplate { } }, Visibility = "public", - PowerLevelContentOverride = new PowerLevelEventData { + PowerLevelContentOverride = new RoomPowerLevelEventData { UsersDefault = 0, EventsDefault = 100, StateDefault = 50, @@ -56,7 +56,7 @@ public class DefaultRoomCreationTemplate : IRoomCreationTemplate { Redact = 50, Kick = 50, Ban = 50, - NotificationsPl = new PowerLevelEventData.NotificationsPL { + NotificationsPl = new RoomPowerLevelEventData.NotificationsPL { Room = 50 }, Events = new Dictionary<string, int> { diff --git a/MatrixRoomUtils.Web/Classes/RoomInfo.cs b/MatrixRoomUtils.Web/Classes/RoomInfo.cs index 5ecc431..f9d5452 100644 --- a/MatrixRoomUtils.Web/Classes/RoomInfo.cs +++ b/MatrixRoomUtils.Web/Classes/RoomInfo.cs @@ -1,13 +1,14 @@ using MatrixRoomUtils.Core; +using MatrixRoomUtils.Core.Interfaces; using MatrixRoomUtils.Core.Responses; using MatrixRoomUtils.Core.RoomTypes; -namespace MatrixRoomUtils.Web.Classes; +namespace MatrixRoomUtils.Web.Classes; public class RoomInfo { public GenericRoom Room { get; set; } public List<StateEventResponse?> StateEvents { get; init; } = new(); - + public async Task<StateEventResponse?> GetStateEvent(string type, string stateKey = "") { var @event = StateEvents.FirstOrDefault(x => x.Type == type && x.StateKey == stateKey); if (@event is not null) return @event; @@ -23,7 +24,8 @@ public class RoomInfo { if (e is { ErrorCode: "M_NOT_FOUND" }) @event.TypedContent = default!; else throw; } + StateEvents.Add(@event); return @event; } -} \ No newline at end of file +} |