about summary refs log tree commit diff
path: root/ExampleBots/ModerationBot/PolicyEngine.cs
diff options
context:
space:
mode:
authorEmma [it/its]@Rory& <root@rory.gay>2024-01-11 07:31:09 +0100
committerEmma [it/its]@Rory& <root@rory.gay>2024-01-11 07:31:09 +0100
commit8dadf547033d71480fd7756809992c0f32549f59 (patch)
treea23631cc840047e3ad9e32dda9c043511af1a583 /ExampleBots/ModerationBot/PolicyEngine.cs
parentTry-create factory for RemoteHomeserver, more reliable RemoteHomeserver creation (diff)
downloadLibMatrix-8dadf547033d71480fd7756809992c0f32549f59.tar.xz
Cleanup, more message formatters, messagebuilder start
Diffstat (limited to 'ExampleBots/ModerationBot/PolicyEngine.cs')
-rw-r--r--ExampleBots/ModerationBot/PolicyEngine.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/ExampleBots/ModerationBot/PolicyEngine.cs b/ExampleBots/ModerationBot/PolicyEngine.cs
index 114b90d..0d0ed65 100644
--- a/ExampleBots/ModerationBot/PolicyEngine.cs
+++ b/ExampleBots/ModerationBot/PolicyEngine.cs
@@ -62,12 +62,12 @@ public class PolicyEngine(AuthenticatedHomeserverGeneric hs, ILogger<ModerationB
         await foreach (var policyList in loadTasks.ToAsyncEnumerable()) {
             policyLists.Add(policyList);
 
-            if (policyList.Policies.Count >= 256 || policyLists.Count == PolicyListAccountData.Count) {
+            if (false || policyList.Policies.Count >= 256 || policyLists.Count == PolicyListAccountData.Count) {
                 var progressMsgContent = MessageFormatter.FormatSuccess($"{policyLists.Count}/{PolicyListAccountData.Count} policy lists loaded, " +
                                                                         $"{policyLists.Sum(x => x.Policies.Count)} policies total, {sw.Elapsed} elapsed.")
                     .SetReplaceRelation<RoomMessageEventContent>(progressMessage.EventId);
 
-                _logRoom?.SendMessageEventAsync(progressMsgContent);
+                await _logRoom?.SendMessageEventAsync(progressMsgContent);
             }
         }
 
@@ -253,7 +253,7 @@ 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].MappedType.Name}";
+            raw += $"\n{stateGroup.Count} | {type} | {stateGroup[0].MappedType.Name}";
             html += $"<tr><td>{stateGroup.Count}</td><td>{type}</td><td>{stateGroup[0].MappedType.Name}</td></tr>";
         }