Method StoreLocalCopyAsync
- Namespace
- MailFathom.Application.Synchronization
- Assembly
- MailFathom.Application.dll
StoreLocalCopyAsync(IPersistenceSession, MailAccountId, MailFolderResolutionId, ExtractedEmailMetadata?, long, CopiedMailFlags, CancellationToken)
Stores the second message a copy on a held account produces, with no occurrence on any server.
Task<StoredEmailId?> StoreLocalCopyAsync(IPersistenceSession session, MailAccountId account, MailFolderResolutionId binding, ExtractedEmailMetadata? extractedMetadata, long sizeOctets, CopiedMailFlags flags, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe explicit persistence session this write participates in.
accountMailAccountIdThe account the copy is stored for.
bindingMailFolderResolutionIdThe folder binding the copy is stored under, which is the copied message's own.
extractedMetadataExtractedEmailMetadataWhat was read out of the copied message's MIME, or null when nothing could be.
sizeOctetslongHow large the message is.
flagsCopiedMailFlagsThe flags and keywords the copied message carries, which the copy takes.
cancellationTokenCancellationTokenPropagates caller cancellation.
Returns
- Task<StoredEmailId?>
The copy's identity, or null where
bindingnames a folder binding that is no longer stored.
Remarks
A binding that is gone is answered rather than raised, for the reason StoreFiledEmailAsync(IPersistenceSession, MailAccountId, MailFolderResolutionId, ExtractedEmailMetadata?, long, AppendedMailFlags, OutgoingEmailId?, CancellationToken) answers one: it was read before the transaction, and the rest of the change the copy belongs to still commits.
The row is stamped as evaluated by the rules, because the copy is MailFathom's own act rather than mail that arrived. It is the local counterpart of the suppression ADR 0008 gives a copy on a mirrored account, where the arrival is withheld from rule evaluation by the record that placed it: without it, a rule that copies into a folder it also matches on would meet its own copy and copy it again.