diff options
author | Emma@Rory& <root@rory.gay> | 2023-09-15 09:55:36 +0200 |
---|---|---|
committer | Emma@Rory& <root@rory.gay> | 2023-09-15 09:55:36 +0200 |
commit | e10fa389ce3c4d42deadfec8bf08c2fbb1a88d79 (patch) | |
tree | 1e2f8d8de07c6037ac4aa20be3b54ac43c2d7f2e /MatrixRoomUtils.Web/Pages/Rooms/PolicyList.razor | |
parent | Code cleanup (diff) | |
download | MatrixUtils-e10fa389ce3c4d42deadfec8bf08c2fbb1a88d79.tar.xz |
Refactors
Diffstat (limited to 'MatrixRoomUtils.Web/Pages/Rooms/PolicyList.razor')
-rw-r--r-- | MatrixRoomUtils.Web/Pages/Rooms/PolicyList.razor | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/MatrixRoomUtils.Web/Pages/Rooms/PolicyList.razor b/MatrixRoomUtils.Web/Pages/Rooms/PolicyList.razor index 2b31389..d2b8360 100644 --- a/MatrixRoomUtils.Web/Pages/Rooms/PolicyList.razor +++ b/MatrixRoomUtils.Web/Pages/Rooms/PolicyList.razor @@ -1,11 +1,11 @@ @page "/Rooms/{RoomId}/Policies" -@using LibMatrix.StateEventTypes -@using System.Text.Json @using LibMatrix @using LibMatrix.Extensions @using LibMatrix.Helpers +@using LibMatrix.Homeservers @using LibMatrix.Responses @using LibMatrix.StateEventTypes.Spec +@using ArcaneLibs.Extensions <h3>Policy list editor - Editing @RoomId</h3> <hr/> @@ -33,8 +33,8 @@ else { </tr> </thead> <tbody> - @foreach (var policyEvent in PolicyEvents.Where(x => x.Type == "m.policy.rule.server" && (x.TypedContent as PolicyRuleStateEventData).Entity is not null)) { - var policyData = policyEvent.TypedContent as PolicyRuleStateEventData; + @foreach (var policyEvent in PolicyEvents.Where(x => x.Type == "m.policy.rule.server" && (x.TypedContent as PolicyRuleEventContent).Entity is not null)) { + var policyData = policyEvent.TypedContent as PolicyRuleEventContent; <tr> <td>Entity: @policyData.Entity<br/>State: @policyEvent.StateKey</td> <td>@policyData.Reason</td> @@ -59,8 +59,8 @@ else { </tr> </thead> <tbody> - @foreach (var policyEvent in PolicyEvents.Where(x => x.Type == "m.policy.rule.server" && (x.TypedContent as PolicyRuleStateEventData).Entity == null)) { - var policyData = policyEvent.TypedContent as PolicyRuleStateEventData; + @foreach (var policyEvent in PolicyEvents.Where(x => x.Type == "m.policy.rule.server" && (x.TypedContent as PolicyRuleEventContent).Entity == null)) { + var policyData = policyEvent.TypedContent as PolicyRuleEventContent; <tr> <td>@policyEvent.StateKey</td> <td>@policyEvent.RawContent.ToJson(false, true)</td> @@ -86,8 +86,8 @@ else { </tr> </thead> <tbody> - @foreach (var policyEvent in PolicyEvents.Where(x => x.Type == "m.policy.rule.room" && (x.TypedContent as PolicyRuleStateEventData).Entity is not null)) { - var policyData = policyEvent.TypedContent as PolicyRuleStateEventData; + @foreach (var policyEvent in PolicyEvents.Where(x => x.Type == "m.policy.rule.room" && (x.TypedContent as PolicyRuleEventContent).Entity is not null)) { + var policyData = policyEvent.TypedContent as PolicyRuleEventContent; <tr> <td>Entity: @policyData.Entity<br/>State: @policyEvent.StateKey</td> <td>@policyData.Reason</td> @@ -111,7 +111,7 @@ else { </tr> </thead> <tbody> - @foreach (var policyEvent in PolicyEvents.Where(x => x.Type == "m.policy.rule.room" && (x.TypedContent as PolicyRuleStateEventData).Entity == null)) { + @foreach (var policyEvent in PolicyEvents.Where(x => x.Type == "m.policy.rule.room" && (x.TypedContent as PolicyRuleEventContent).Entity == null)) { <tr> <td>@policyEvent.StateKey</td> <td>@policyEvent.RawContent!.ToJson(false, true)</td> @@ -140,8 +140,8 @@ else { </tr> </thead> <tbody> - @foreach (var policyEvent in PolicyEvents.Where(x => x.Type == "m.policy.rule.user" && (x.TypedContent as PolicyRuleStateEventData).Entity is not null)) { - var policyData = policyEvent.TypedContent as PolicyRuleStateEventData; + @foreach (var policyEvent in PolicyEvents.Where(x => x.Type == "m.policy.rule.user" && (x.TypedContent as PolicyRuleEventContent).Entity is not null)) { + var policyData = policyEvent.TypedContent as PolicyRuleEventContent; <tr> @if (_enableAvatars) { <td scope="col"> @@ -170,7 +170,7 @@ else { </tr> </thead> <tbody> - @foreach (var policyEvent in PolicyEvents.Where(x => x.Type == "m.policy.rule.user" && (x.TypedContent as PolicyRuleStateEventData).Entity == null)) { + @foreach (var policyEvent in PolicyEvents.Where(x => x.Type == "m.policy.rule.user" && (x.TypedContent as PolicyRuleEventContent).Entity == null)) { <tr> <td>@policyEvent.StateKey</td> <td>@policyEvent.RawContent.ToJson(false, true)</td> @@ -245,8 +245,8 @@ else { } private async Task GetAllAvatars() { - foreach (var policyEvent in PolicyEvents.Where(x => x.Type == "m.policy.rule.user" && (x.TypedContent as PolicyRuleStateEventData).Entity is not null)) { - await GetAvatar((policyEvent.TypedContent as PolicyRuleStateEventData).Entity); + foreach (var policyEvent in PolicyEvents.Where(x => x.Type == "m.policy.rule.user" && (x.TypedContent as PolicyRuleEventContent).Entity is not null)) { + await GetAvatar((policyEvent.TypedContent as PolicyRuleEventContent).Entity); } StateHasChanged(); } |