about summary refs log tree commit diff
path: root/LibMatrix.EventTypes/Spec/State
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-08-11 15:12:27 +0200
committerRory& <root@rory.gay>2025-08-11 15:12:27 +0200
commit1feb7fb87444807c3fb5d266fa3cb76069c061a1 (patch)
tree09b543de89834b895d6c45c52aa6d6df5b374e22 /LibMatrix.EventTypes/Spec/State
parentHandle room upgrades (diff)
downloadLibMatrix-1feb7fb87444807c3fb5d266fa3cb76069c061a1.tar.xz
Update dependencies, more support for room upgrades
Diffstat (limited to 'LibMatrix.EventTypes/Spec/State')
-rw-r--r--LibMatrix.EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs18
1 files changed, 17 insertions, 1 deletions
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 { /// </summary> 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 + /// <summary> + /// Take down the user with all means available + /// </summary> + public static string Takedown = "org.matrix.msc4204.takedown"; //stable prefix: m.takedown, msc pending } public class PolicyHash {