Class MailDraftDirectory
- Namespace
- MailFathom.Application.Mail.Delivery.Drafts
- Assembly
- MailFathom.Application.dll
Answers which drafts the user in hand is writing, and resolves one of them by identity.
public sealed class MailDraftDirectory
- Inheritance
-
MailDraftDirectory
- Inherited Members
Remarks
It exists because a person composing mail needs their drafts back after closing the window, and because the acts beneath it — revising a draft, giving one up, keeping one on the server, attaching a file to one — name a draft by an identifier that says nothing about whose it is. MailDraftBook admits those acts on the grant alone, which is what a deployment holding one user needs and not what a user-facing surface may rely on, so this is where an identifier becomes a draft the caller's own user holds.
A draft another user holds answers exactly as one nobody holds. There is no listing that crosses users, no refusal that separates the two cases, and no timing that does either, which is the same rule every user-facing read here follows.
It is published under MailDraftsWrite rather than under MailRead, which is the same choice the outgoing reader makes: what a draft says is what this caller was allowed to compose, and a credential granted to read a mailbox has not been granted to read the outgoing correspondence being prepared in it.
The answer is bounded and carries no cursor. Drafts are what one person has open at a time rather than a corpus, so a bound a screen cannot exhaust is the whole of what a listing needs — and a cursor into somebody's composition would be a walk over their unsent mail rather than a page of it.
Constructors
- MailDraftDirectory(ICallerMailAccountCatalog, IMailDraftStore, IEmailContentStore, IOutgoingMailTextReader, AccessAuthorization)
Answers which drafts the user in hand is writing, and resolves one of them by identity.
Fields
- MaximumCount
The greatest number of drafts one reading answers with.
Methods
- FindAsync(MailDraftId, CancellationToken)
Reads one draft of the caller's own user, or answers that they hold none under that identifier.
- ReadAsync(MailAccountSelector?, CancellationToken)
Reads the drafts the caller's user is writing, newest edit first.
- ReadComposedAsync(MailDraftId, CancellationToken)
Reads one of the caller's own drafts back as the words its author wrote, so editing can go on.