mirror of
https://github.com/apple/swift-nio-imap
synced 2026-11-27 05:04:23 +00:00
The existing code was not able to differentiate between
A1 SEARCH ANSWERED
A1 SEARCH RETURN () ANSWERED
commands. The former is an RFC 3501 style search, the latter an RFC 4731 style search.
RFC 3501 does not allow for any RETURN options.
With this PR, those get mapped to
public enum Command: Hashable {
...
case search(key: SearchKey, charset: String? = nil, returnOptions: [SearchReturnOption] = [])
such that returnOptions are empty for RFC 3501 style searches, wheras RFC 4731 style searches will always contain at least one element.
Note that RETURN () is a shorthand for RETURN (ALL), and as such gets mapped to [.all].
This is called out in the comments for Command.search.
Also
The SearchCorrelator’s tag is now a String to align with TaggedCommand’s tag.
SearchReturnData now uses UnknownMessageIdentifier instead of Int for min and max.