Table of Contents

Class EmailThreadContexts

Namespace
MailFathom.Application.Emails.Threads
Assembly
MailFathom.Application.dll

Assembles the conversations one content read has to publish, once each.

public sealed class EmailThreadContexts
Inheritance
EmailThreadContexts
Inherited Members

Remarks

Built for a single read and thrown away with it. A read names up to ten emails and they are routinely the same exchange, so assembling per email would read one conversation ten times, order it ten times, and — where a scanner is switched on — scan every subject in it ten times. The instance is what makes each of those happen once.

Three things happen here in one place because they have to happen in this order. Folder visibility is applied first, and it is applied in the query rather than to its answer: the read is bounded, so a withheld message left for this class to drop would have spent one of those rows and pushed a readable message out of the conversation. The order is produced from what comes back, so a message whose parent is withheld becomes a root of what the caller is shown; and the subjects are scanned last, so what leaves this read has been through the same scanner the listing and the search send theirs through.

Constructors

EmailThreadContexts(IEmailThreadReader, MailboxScopeResolver, SensitiveContentEgressGuard)

Initializes the per-read assembly.

Methods

AssembleAsync(EmailThreadId, CancellationToken)

Reads one conversation in its own order, out of the mail the caller may see.

ContextForAsync(EmailThreadId?, StoredEmailId, CancellationToken)

Builds what one read email publishes about the conversation it belongs to.