Class EmailThreadState
- Namespace
- MailFathom.Application.Emails.ThreadStates
- Assembly
- MailFathom.Application.dll
Where one conversation stands, as this deployment derived it and wrote it down.
public sealed record EmailThreadState : IEquatable<EmailThreadState>
- Inheritance
-
EmailThreadState
- Implements
- Inherited Members
Remarks
Derived once and stored, which is the whole of what makes it a part of the application rather than a chat reply somebody has to ask for again. A summary produced on demand and discarded is a message with better placement; a state that is derived, kept, updated when the conversation changes, and cited is an object a screen can be built on and a later stage can read.
A record with no statements at all is a real outcome and not a failure. It says a derivation ran and found nothing to put beside the conversation — two messages arranging a time, a receipt and its acknowledgement — and storing it is what stops the same nothing being paid for again. A conversation no derivation has reached carries no record at all, which is what a client draws as *not derived yet* rather than as *nothing to say*.
It carries no participant list, and that is deliberate rather than missing. Who is taking part in a conversation is something the correspondence states exactly — the authors of its messages — and the thread route already publishes it from the mail itself. Asking a model for it would store a second, worse copy of a fact the mailbox holds, and a screen showing the two side by side would have to decide which one is right.
Constructors
- EmailThreadState(EmailThreadId, ThreadStateCoverage, IReadOnlyList<ThreadStateEntry>, ThreadStateRevision, DateTimeOffset, bool)
Where one conversation stands, as this deployment derived it and wrote it down.
Fields
- MaximumEntriesPerAspect
The greatest number of statements one aspect of a state holds.
Properties
- Coverage
How much of the conversation the derivation was shown.
- DerivedAt
When the derivation ran.
- DerivedFrom
The shape of the conversation the derivation was made from.
- Entries
What was derived, in the order the producer named it, and empty where there was nothing to say.
- IsCurrent
Whether the conversation still has the shape the state was derived from. A state just derived is current by construction; a stored one stops being current the moment a message joins or leaves the conversation, and stays so until a pass derives it again — which can be indefinitely, while the answering allowance is spent. A reader is never shown one that is not as though it were.
- ThreadId
The conversation this state is about, which is always the surviving thread of a merge.
Methods
- Leading()
Narrows the state to the statements a reader is shown: the leading ones of each aspect.
- Of(ThreadStateAspect)
Gets the statements of one aspect, in the order the producer named them.