Table of Contents

Method PrepareCopiesAsync

Namespace
MailFathom.Application.Rules.Actions
Assembly
MailFathom.Application.dll

PrepareCopiesAsync(MailAccountId, IReadOnlyCollection<StoredEmailId>, CancellationToken)

Places the payload of every copy a batch asks for, before the transaction that records them opens.

public Task<PreparedLocalCopies> PrepareCopiesAsync(MailAccountId account, IReadOnlyCollection<StoredEmailId> sources, CancellationToken cancellationToken)

Parameters

account MailAccountId

The account the batch acts on.

sources IReadOnlyCollection<StoredEmailId>

The email each planned copy duplicates, one entry per copy action.

cancellationToken CancellationToken

Propagates caller cancellation.

Returns

Task<PreparedLocalCopies>

The placed copies, or none at all where the account is not held.

Remarks

It is handed on to the submission rather than performed here, for the reason Announce(IEnumerable<AppliedMailboxChange>) is: the choice of executor is the submission's, so a rule pass asks the recorder it already talks to instead of gaining a second collaborator to ask about the same account.