using PrivaPub.ClientModels.Resources; using System.ComponentModel.DataAnnotations; namespace PrivaPub.ClientModels.User.Avatar { // How a persona's clients show what others post (R8): Mastodon's reading:expand:media ("default" hides media marked // sensitive, "show_all", "hide_all") and reading:expand:spoilers, which GET /api/v1/preferences answers. Mastodon's API // sets neither, so they are set here: GET and POST /clientapi/avatar/private/preferences, for the login's own persona. public class ViewPersonaPreferences { public string AvatarId { get; set; } public string ExpandMedia { get; set; } public bool ExpandSpoilers { get; set; } = false; } public class PersonaPreferencesForm { [Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)), Display(Name = nameof(AvatarId), ResourceType = typeof(FieldsNameResource))] public string AvatarId { get; set; } [Required(ErrorMessageResourceName = "Required", ErrorMessageResourceType = typeof(ErrorsResource)), StringLength(16, ErrorMessageResourceName = "StringLength", ErrorMessageResourceType = typeof(ErrorsResource))] public string ExpandMedia { get; set; }//"default", "show_all" or "hide_all" public bool ExpandSpoilers { get; set; } = false; } }