about summary refs log tree commit diff
path: root/LibMatrix.EventTypes
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
parentHandle room upgrades (diff)
downloadLibMatrix-1feb7fb87444807c3fb5d266fa3cb76069c061a1.tar.xz
Update dependencies, more support for room upgrades
Diffstat (limited to 'LibMatrix.EventTypes')
-rw-r--r--LibMatrix.EventTypes/LibMatrix.EventTypes.csproj2
-rw-r--r--LibMatrix.EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs18
2 files changed, 18 insertions, 2 deletions
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 @@ </PropertyGroup> <ItemGroup> - <PackageReference Include="ArcaneLibs" Version="1.0.0-preview.20250630-114950" Condition="'$(Configuration)' == 'Release'" /> + <PackageReference Include="ArcaneLibs" Version="1.0.0-preview.20250806-011111" Condition="'$(Configuration)' == 'Release'" /> <ProjectReference Include="..\ArcaneLibs\ArcaneLibs\ArcaneLibs.csproj" Condition="'$(Configuration)' == 'Debug'"/> </ItemGroup> 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 {