Method DiscardAttachmentTextAsync
- Namespace
- MailFathom.Application.Emails.AttachmentText
- Assembly
- MailFathom.Application.dll
DiscardAttachmentTextAsync(IPersistenceSession, StoredEmailId, CancellationToken)
Stages the removal of every reading stored for one message's attachments.
Task<int> DiscardAttachmentTextAsync(IPersistenceSession session, StoredEmailId emailId, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe explicit persistence session this removal participates in.
emailIdStoredEmailIdThe message whose readings are removed.
cancellationTokenCancellationTokenCancels the read before anything is staged.
Returns
- Task<int>
How many readings the removal reached, which is zero for a message whose attachments nothing read.
Remarks
The junk verdict's other half. A reading is a second durable copy of derived mail content — a document's whole text, a model's description of a picture, and the file name a sender chose — so removing the passages cut from it while leaving it stored would keep exactly what the verdict called for the removal of. The message's derivation stamp is cleared with the rows, so a message the classification gate later re-admits is read again rather than left permanently without attachment text: junk stays out of the walk on the gate, which is what a reversed verdict moves, rather than on a stamp nothing would ever clear. Idempotent and staged, on the same terms the passage removal is.