From 1feb7fb87444807c3fb5d266fa3cb76069c061a1 Mon Sep 17 00:00:00 2001 From: Rory& Date: Mon, 11 Aug 2025 15:12:27 +0200 Subject: Update dependencies, more support for room upgrades --- LibMatrix.EventTypes/LibMatrix.EventTypes.csproj | 2 +- .../Spec/State/Policy/PolicyRuleStateEventContent.cs | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'LibMatrix.EventTypes') diff --git a/LibMatrix.EventTypes/LibMatrix.EventTypes.csproj b/LibMatrix.EventTypes/LibMatrix.EventTypes.csproj index 682b91b..a2b22b5 100644 --- a/LibMatrix.EventTypes/LibMatrix.EventTypes.csproj +++ b/LibMatrix.EventTypes/LibMatrix.EventTypes.csproj @@ -7,7 +7,7 @@ - + diff --git a/LibMatrix.EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs b/LibMatrix.EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs index d75b19f..24b8f90 100644 --- a/LibMatrix.EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs +++ b/LibMatrix.EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs @@ -124,6 +124,19 @@ public abstract class PolicyRuleEventContent : EventContent { return Recommendation; } + + public string? GetSpecRecommendation() { + if (Recommendation is "m.ban" or "org.matrix.mjolnir.ban") + return PolicyRecommendationTypes.Ban; + + if (Recommendation is "m.mute" or "support.feline.policy.recommendation_mute") + return PolicyRecommendationTypes.Mute; + + if (Recommendation is "m.takedown" or "org.matrix.msc4204.takedown") + return PolicyRecommendationTypes.Takedown; + + return Recommendation; + } } public static class PolicyRecommendationTypes { @@ -137,7 +150,10 @@ public static class PolicyRecommendationTypes { /// public static string Mute = "support.feline.policy.recommendation_mute"; //stable prefix: m.mute, msc pending - public static string Takedown = "m.takedown"; //unstable prefix: org.matrix.msc4204.takedown + /// + /// Take down the user with all means available + /// + public static string Takedown = "org.matrix.msc4204.takedown"; //stable prefix: m.takedown, msc pending } public class PolicyHash { -- cgit 1.5.1