diff options
author | Rory& <root@rory.gay> | 2024-01-31 18:50:16 +0100 |
---|---|---|
committer | Rory& <root@rory.gay> | 2024-01-31 18:50:16 +0100 |
commit | d133a168c17d605236e967ff63728420ddb0ed98 (patch) | |
tree | ac467c42591db6fb6b920682dd54da1f707f8c0c /ExampleBots/ModerationBot/StateEventTypes/Policies/BasePolicy.cs | |
parent | Capabilities (diff) | |
download | LibMatrix-d133a168c17d605236e967ff63728420ddb0ed98.tar.xz |
Repo split
Diffstat (limited to 'ExampleBots/ModerationBot/StateEventTypes/Policies/BasePolicy.cs')
-rw-r--r-- | ExampleBots/ModerationBot/StateEventTypes/Policies/BasePolicy.cs | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/ExampleBots/ModerationBot/StateEventTypes/Policies/BasePolicy.cs b/ExampleBots/ModerationBot/StateEventTypes/Policies/BasePolicy.cs deleted file mode 100644 index 64b0448..0000000 --- a/ExampleBots/ModerationBot/StateEventTypes/Policies/BasePolicy.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Text.Json.Serialization; -using LibMatrix; -using LibMatrix.EventTypes; -using LibMatrix.Interfaces; - -namespace ModerationBot.StateEventTypes.Policies; - -public abstract class BasePolicy : EventContent { - /// <summary> - /// Entity this policy applies to, null if event was redacted - /// </summary> - [JsonPropertyName("entity")] - public string? Entity { get; set; } - - /// <summary> - /// Reason this policy exists - /// </summary> - [JsonPropertyName("reason")] - public string? Reason { get; set; } - - /// <summary> - /// Suggested action to take, one of `ban`, `kick`, `mute`, `redact`, `spoiler`, `warn` or `warn_admins` - /// </summary> - [JsonPropertyName("recommendation")] - [AllowedValues("ban", "kick", "mute", "redact", "spoiler", "warn", "warn_admins")] - public string Recommendation { get; set; } = "warn"; - - /// <summary> - /// Expiry time in milliseconds since the unix epoch, or null if the ban has no expiry. - /// </summary> - [JsonPropertyName("support.feline.policy.expiry.rev.2")] //stable prefix: expiry, msc pending - public long? Expiry { get; set; } - - //utils - /// <summary> - /// Readable expiry time, provided for easy interaction - /// </summary> - [JsonPropertyName("gay.rory.matrix_room_utils.readable_expiry_time_utc")] - public DateTime? ExpiryDateTime { - get => Expiry == null ? null : DateTimeOffset.FromUnixTimeMilliseconds(Expiry.Value).DateTime; - set => Expiry = value is null ? null : ((DateTimeOffset)value).ToUnixTimeMilliseconds(); - } - - #region Internal metadata - - [JsonIgnore] - public PolicyList PolicyList { get; set; } - - public StateEventResponse OriginalEvent { get; set; } - - #endregion -} |