From 71d115dc8e915a620dd935955ba980fcbe421dad Mon Sep 17 00:00:00 2001 From: "Emma [it/its]@Rory&" Date: Fri, 1 Dec 2023 12:16:00 +0100 Subject: Cleanup, move ArcaneLibs to submodule instead of parent submodule --- .../State/Policy/PolicyRuleStateEventContent.cs | 23 ++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'LibMatrix/EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs') diff --git a/LibMatrix/EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs b/LibMatrix/EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs index 757a9e9..80d87d6 100644 --- a/LibMatrix/EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs +++ b/LibMatrix/EventTypes/Spec/State/Policy/PolicyRuleStateEventContent.cs @@ -4,27 +4,34 @@ using LibMatrix.Interfaces; namespace LibMatrix.EventTypes.Spec.State; //spec -[MatrixEvent(EventName = "m.policy.rule.server")] //spec +[MatrixEvent(EventName = EventId)] //spec [MatrixEvent(EventName = "m.room.rule.server")] //??? [MatrixEvent(EventName = "org.matrix.mjolnir.rule.server")] //legacy -public class ServerPolicyRuleEventContent : PolicyRuleEventContent { } +public class ServerPolicyRuleEventContent : PolicyRuleEventContent { + public const string EventId = "m.policy.rule.server"; +} -[MatrixEvent(EventName = "m.policy.rule.user")] //spec +[MatrixEvent(EventName = EventId)] //spec [MatrixEvent(EventName = "m.room.rule.user")] //??? [MatrixEvent(EventName = "org.matrix.mjolnir.rule.user")] //legacy -public class UserPolicyRuleEventContent : PolicyRuleEventContent { } +public class UserPolicyRuleEventContent : PolicyRuleEventContent { + public const string EventId = "m.policy.rule.user"; +} -[MatrixEvent(EventName = "m.policy.rule.room")] //spec +[MatrixEvent(EventName = EventId)] //spec [MatrixEvent(EventName = "m.room.rule.room")] //??? [MatrixEvent(EventName = "org.matrix.mjolnir.rule.room")] //legacy -public class RoomPolicyRuleEventContent : PolicyRuleEventContent { } +public class RoomPolicyRuleEventContent : PolicyRuleEventContent { + public const string EventId = "m.policy.rule.room"; +} public abstract class PolicyRuleEventContent : EventContent { /// /// Entity this ban applies to, can use * and ? as globs. + /// Policy is invalid if entity is null /// [JsonPropertyName("entity")] - public string Entity { get; set; } + public string? Entity { get; set; } /// /// Reason this user is banned @@ -65,4 +72,4 @@ public static class PolicyRecommendationTypes { /// Mute this user /// public static string Mute = "support.feline.policy.recommendation_mute"; //stable prefix: m.mute, msc pending -} \ No newline at end of file +} -- cgit 1.4.1