Table of Contents

Method ReadStagedAttachmentsAsync

Namespace
MailFathom.Application.Mail.Delivery.Drafts
Assembly
MailFathom.Application.dll

ReadStagedAttachmentsAsync(MailAccountId, UserId, MailDraftId?, CancellationToken)

Reads the files staged against the draft a revision replaces, so the new revision carries them too.

public Task<IReadOnlyList<AuthoredEmailAttachment>> ReadStagedAttachmentsAsync(MailAccountId account, UserId writtenBy, MailDraftId? revises, CancellationToken cancellationToken)

Parameters

account MailAccountId

The account the caller's own resolution named, which the draft has to belong to.

writtenBy UserId

The user asking, who has to be the one the draft was written by.

revises MailDraftId?

The draft being revised, or null where a new one is being written.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<IReadOnlyList<AuthoredEmailAttachment>>

The staged files with their octets, empty for a new draft and for one nothing is attached to.

Remarks

A file is uploaded once and belongs to the draft rather than to one revision of it, so every composition after the upload has to carry it. Reading them here rather than in each author is what keeps that true of every boundary that composes a draft.

The draft is established as this user's own before a single octet is read. The identifier arrived from whoever asked, and the write beneath this establishes authorship too — but it does so after a composition that these files are part of, so a read placed before it would carry another person's attachments into this request and answer a bound-exceeded refusal where a foreign identifier has to answer exactly as an unknown one. Reading nothing until the check has passed is what leaves the two indistinguishable, in the size of the answer as well as in its code. The account alone would not settle it, two people being assignable to one mailbox.

Exceptions

MailDraftRefusedException

Thrown when revises names no draft this account holds as a revisable one of writtenBy's.