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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user