using MongoDB.Entities; namespace PrivaPub.Models.Post { // One of this server's own custom emoji (completion program R7), added by an administrator // (/clientapi/admin/emoji, EmojiAdminController). Its shortcode is its name everywhere: `:shortcode:` in a post, and // its federated id (/grimaces/{shortcode}, Domain/Content/LocalEmojis.Path), which is why it is never renamed. Its picture // is a MediaAttachment nobody owns, held by ServerUse "emoji:" while the emoji exists. Deleted, the row stays // (DeletedAt) so its id answers 410; adding the same shortcode again brings the row back with a new picture. public class LocalEmoji : Entity { public string Shortcode { get; set; }//as written, [a-zA-Z0-9_]{2,64} (Mastodon's rule); matched exactly in texts public string Key { get; set; }//the shortcode in lower case: unique, so `Blob` and `blob` are never two emoji public string Category { get; set; } public bool VisibleInPicker { get; set; } = true; public bool Disabled { get; set; } = false;//kept, but offered nowhere and taken into no new post public string MediaId { get; set; }//its picture's MediaAttachment (ServerUse "emoji:") public string Url { get; set; }//the picture: a PNG, or an animated GIF public string StaticUrl { get; set; }//a still PNG of it (the first frame of a GIF; the picture itself otherwise) public string ContentType { get; set; }//image/png or image/gif public int? Width { get; set; } public int? Height { get; set; } public long Size { get; set; } public DateTime CreatedAt { get; set; } = DateTime.UtcNow; public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;//any change public DateTime ImageUpdatedAt { get; set; } = DateTime.UtcNow;//its picture's: the Emoji's `updated`, which tells peers to fetch it again public DateTime? DeletedAt { get; set; } } }