Method SetFlaggedAsync
- Namespace
- MailFathom.Application.Mail.Mutations
- Assembly
- MailFathom.Application.dll
SetFlaggedAsync(EmailOccurrenceId, bool, IMailboxMutationJournal, CancellationToken)
Sets or clears the remote \Flagged flag of one email in this session's folder.
Task SetFlaggedAsync(EmailOccurrenceId occurrenceId, bool isFlagged, IMailboxMutationJournal journal, CancellationToken cancellationToken)
Parameters
occurrenceIdEmailOccurrenceIdThe occurrence to flag, which must belong to this session's account, folder, and UIDVALIDITY.
isFlaggedbooljournalIMailboxMutationJournalThe 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
The \Seen flag is not part of this operation. Both write one flag and leave every other one exactly as the
server holds it, which is what keeps each of them the answer to the question it was asked.
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.