namespace MailSharp.MailClient.Models; public class CachedMessageList { public string Id { get; set; } = ""; public DateTimeOffset CachedAt { get; set; } public List Messages { get; set; } = []; } public class SenderImagePreference { public string Id { get; set; } = ""; public bool AllowImages { get; set; } } // Maps an image's URL hash to its original source URL, so the /cache/images/{hash} handler can // download it on the first request even though the hash itself can't be reversed back to a URL. public class ImageUrlMapping { public string Id { get; set; } = ""; public string Url { get; set; } = ""; } // Maps a (account, folder, uid) triple - the only thing we know before contacting IMAP - to the // message's own globally-unique Message-ID, which is the actual cache key for the .eml file // (uids are only unique within a single folder, not account-wide, and change when a message is // moved between folders; Message-ID doesn't). public class MessageIdMapping { public string Id { get; set; } = ""; public string MessageId { get; set; } = ""; } public class ContactOverride { public string Id { get; set; } = ""; public string DisplayName { get; set; } = ""; } // One row per account, holding the full contact address list scraped from Sent - fetching it // requires walking the whole Sent folder over IMAP, so it's done once and then kept up to date // incrementally (see IContactStore.AddContacts) instead of being re-fetched on every page load. public class ContactCache { public int Id { get; set; } public List Contacts { get; set; } = []; } // Caches the result of IImapService.SearchByAddressAsync (all mails to/from one contact), keyed // by (account, email) - that search walks every folder over IMAP, so repeatedly opening the same // contact shouldn't repeat it every time; a short TTL (like the message list cache) still lets it // pick up newly arrived/sent mail without needing an explicit invalidation. public class ContactMailSearchCache { public string Id { get; set; } = ""; public DateTimeOffset CachedAt { get; set; } public List Results { get; set; } = []; }