Table of Contents

Method CountMessagesAuthoredByAsync

Namespace
MailFathom.Application.Contacts.Collection
Assembly
MailFathom.Application.dll

CountMessagesAuthoredByAsync(MailAccountId, EmailAddress, int, CancellationToken)

Counts the messages of one account that one address authored.

Task<int> CountMessagesAuthoredByAsync(MailAccountId accountId, EmailAddress author, int ceiling, CancellationToken cancellationToken)

Parameters

accountId MailAccountId

The account whose stored mail is counted.

author EmailAddress

The address to count the messages of.

ceiling int

The count to stop at, because the caller only asks whether a threshold is reached.

cancellationToken CancellationToken

Cancels the read.

Returns

Task<int>

How many messages that address wrote, at most ceiling.

Remarks

One message stored in two folders of one account counts once, because what the threshold is about is how often somebody wrote rather than how many copies of it a mailbox keeps. A message whose sender wrote no identifier for it is counted per stored copy, since nothing else distinguishes two of them.

Exceptions

ArgumentOutOfRangeException

Thrown when ceiling is not positive.