Method SetSeenAsync
- Namespace
- MailFathom.Application.Mail.Mutations
- Assembly
- MailFathom.Application.dll
SetSeenAsync(EmailOccurrenceId, bool, IMailboxMutationJournal, CancellationToken)
Sets or clears the remote \Seen flag of one email in this session's folder.
Task SetSeenAsync(EmailOccurrenceId occurrenceId, bool isSeen, IMailboxMutationJournal journal, CancellationToken cancellationToken)
Parameters
occurrenceIdEmailOccurrenceIdThe occurrence to flag, which must belong to this session's account, folder, and UIDVALIDITY.
isSeenbooljournalIMailboxMutationJournalThe durable record of this flag change, which exists for provenance rather than for retry safety.
cancellationTokenCancellationTokenCancels the flag write.
Returns
- Task
A task that completes when the server has recorded the flag.
Remarks
Both directions are the same mutation, because both are the same authored act about the same flag. This is the
only operation in MailFathom that writes \Seen; the stored value stays a snapshot of what the server
reports, written by synchronization observing the result rather than by this call.
Exceptions
- ArgumentException
Thrown when
occurrenceIddoes not belong to this session.- ArgumentNullException
Thrown when
journalis null.- MailboxUnavailableException
Thrown when the mail server did not serve the flag write within its configured resilience budget.
- MailboxFolderRecreatedException
Thrown when a recovered connection reselected the folder with a different UIDVALIDITY.