Method ReadForUserAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Drafts
- Assembly
- MailFathom.Application.dll
ReadForUserAsync(UserId, MailAccountId?, int, CancellationToken)
Reads the drafts one user is still writing, newest edit first.
Task<IReadOnlyList<MailDraftRecord>> ReadForUserAsync(UserId user, MailAccountId? account, int maxCount, CancellationToken cancellationToken)
Parameters
userUserIdThe user whose drafts are read.
accountMailAccountId?The account to narrow to, or null for every account this user owns.
maxCountintThe greatest number of drafts to answer with.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<IReadOnlyList<MailDraftRecord>>
The drafts, ordered by when each last changed, newest first, bounded by
maxCount.
Remarks
It is the user's own listing rather than a pass's, so what it answers with is what a person would recognize as their drafts: one that has been given up is on its way out and one that has been promoted is a queued message, and neither is something to go on editing. Bounded rather than paged, because the set is what one person has open at a time — a user who reaches the bound has more drafts than a screen shows and is told so by the count rather than handed a cursor into their own composition.