using System; using SQLite; using Wino.Core.Domain.Enums; using Wino.Core.Domain.Models.MailItem; namespace Wino.Core.Domain.Entities { /// /// Summary of the parsed MIME messages. /// Wino will do non-network operations on this table and others from the original MIME. /// public class MailCopy : IMailItem { /// /// Unique Id of the mail. /// [PrimaryKey] public Guid UniqueId { get; set; } /// /// Not unique id of the item. Some operations held on this Id, some on the UniqueId. /// Same message can be in different folder. In that case UniqueId is used. /// public string Id { get; set; } /// /// Folder that this mail belongs to. /// public Guid FolderId { get; set; } /// /// Conversation id for the mail. /// public string ThreadId { get; set; } /// /// MIME MessageId if exists. /// public string MessageId { get; set; } /// /// References header from MIME /// public string References { get; set; } /// /// In-Reply-To header from MIME /// public string InReplyTo { get; set; } /// /// Name for the sender. /// public string FromName { get; set; } /// /// Address of the sender. /// public string FromAddress { get; set; } /// /// Subject of the mail. /// public string Subject { get; set; } /// /// Short preview of the content. /// public string PreviewText { get; set; } /// /// Date that represents this mail has been created in provider servers. /// Stored always in UTC. /// public DateTime CreationDate { get; set; } /// /// Importance of the mail. /// public MailImportance Importance { get; set; } /// /// Read status for the mail. /// public bool IsRead { get; set; } /// /// Flag status. /// Flagged for Outlook. /// Important for Gmail. /// public bool IsFlagged { get; set; } /// /// To support Outlook. /// Gmail doesn't use it. /// public bool IsFocused { get; set; } /// /// Whether mail has attachments included or not. /// public bool HasAttachments { get; set; } /// /// Assigned draft id. /// public string DraftId { get; set; } /// /// Whether this copy is draft or not. /// public bool IsDraft { get; set; } /// /// File id that this mail is assigned to. /// This Id is immutable. It's used to find the file in the file system. /// Even after mapping local draft to remote draft, it will not change. /// public Guid FileId { get; set; } /// /// Folder that this mail is assigned to. /// Warning: This field is not populated by queries. /// Services or View Models are responsible for populating this field. /// [Ignore] public MailItemFolder AssignedFolder { get; set; } /// /// Account that this mail is assigned to. /// Warning: This field is not populated by queries. /// Services or View Models are responsible for populating this field. /// [Ignore] public MailAccount AssignedAccount { get; set; } public override string ToString() => $"{Subject} <-> {Id}"; } }