about summary refs log tree commit diff
path: root/PolicyEngine.cs
diff options
context:
space:
mode:
authorEmma [it/its]@Rory& <root@rory.gay>2024-01-05 12:22:42 +0100
committerEmma [it/its]@Rory& <root@rory.gay>2024-01-05 12:22:42 +0100
commitb539ad26f187ab0f9d747b2eb7453a4a5359f786 (patch)
treed76f5f47318c0707eb5521b56c52908abf55f3d8 /PolicyEngine.cs
parentCleanup (diff)
downloadModerationBot-b539ad26f187ab0f9d747b2eb7453a4a5359f786.tar.xz
Cleanup
Diffstat (limited to '')
-rw-r--r--PolicyEngine.cs8
1 files changed, 4 insertions, 4 deletions
diff --git a/PolicyEngine.cs b/PolicyEngine.cs
index 5af99ac..114b90d 100644
--- a/PolicyEngine.cs
+++ b/PolicyEngine.cs
@@ -85,8 +85,8 @@ public class PolicyEngine(AuthenticatedHomeserverGeneric hs, ILogger<ModerationB
         var stateEvents = room.GetFullStateAsync();
         await foreach (var stateEvent in stateEvents) {
             if (stateEvent != null && (
-                    stateEvent.GetType.IsAssignableTo(typeof(BasePolicy))
-                    || stateEvent.GetType.IsAssignableTo(typeof(PolicyRuleEventContent))
+                    stateEvent.MappedType.IsAssignableTo(typeof(BasePolicy))
+                    || stateEvent.MappedType.IsAssignableTo(typeof(PolicyRuleEventContent))
                 )) {
                 policyList.Policies.Add(stateEvent);
             }
@@ -253,8 +253,8 @@ public class PolicyEngine(AuthenticatedHomeserverGeneric hs, ILogger<ModerationB
         string raw = "Count | State type | Mapped type", html = "<table><tr><th>Count</th><th>State type</th><th>Mapped type</th></tr>";
         var groupedStates = states.GroupBy(x => x.Type).ToDictionary(x => x.Key, x => x.ToList()).OrderByDescending(x => x.Value.Count);
         foreach (var (type, stateGroup) in groupedStates) {
-            raw += $"{stateGroup.Count} | {type} | {stateGroup[0].GetType.Name}";
-            html += $"<tr><td>{stateGroup.Count}</td><td>{type}</td><td>{stateGroup[0].GetType.Name}</td></tr>";
+            raw += $"{stateGroup.Count} | {type} | {stateGroup[0].MappedType.Name}";
+            html += $"<tr><td>{stateGroup.Count}</td><td>{type}</td><td>{stateGroup[0].MappedType.Name}</td></tr>";
         }
 
         html += "</table>";