Refactor email fetching logic in EmailController

Consolidated email fetching endpoints by removing `FetchEmailUids`
and `FetchEmailByUid` endpoints and integrating their functionality
into the `FetchEmails` method. Introduced an `OnlyFilter` enum to
allow filtering responses for HTML body or UIDs. Removed related
methods (`FetchEmailUidsAsync`, `FetchEmailByUidAsync`) from
`IImapEmailService` and deleted associated query classes and
handlers.
This commit is contained in:
2026-08-12 12:42:15 +02:00
parent 118612206e
commit cb3b2e09ab
4 changed files with 28 additions and 177 deletions

View File

@@ -22,27 +22,6 @@ public interface IImapEmailService
MailSearchFilter filter,
CancellationToken cancellationToken = default);
/// <summary>
/// Fetches only the UIDs of messages matching the specified filter.
/// </summary>
Task<IEnumerable<long>> FetchEmailUidsAsync(
EmailAccountDto account,
MailSearchFilter filter,
CancellationToken cancellationToken = default);
/// <summary>
/// Fetches a single email by its UID.
/// </summary>
/// When <see langword="true"/> (default), the message is marked as <c>\Seen</c> on the server.
/// Set to <see langword="false"/> for a non-destructive read.
/// </param>
Task<ReceivedEmailContext?> FetchEmailByUidAsync(
EmailAccountDto account,
long uid,
string folder = "INBOX",
bool withAttachments = false,
CancellationToken cancellationToken = default);
/// <summary>
/// Marks a message as seen (read) on the server.
/// </summary>