Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add commonly announced Capabilities to NIOIMAP.Capability #50

Closed
danieleggert opened this issue Apr 17, 2020 · 1 comment · Fixed by #66
Closed

Add commonly announced Capabilities to NIOIMAP.Capability #50

danieleggert opened this issue Apr 17, 2020 · 1 comment · Fixed by #66
Assignees

Comments

@danieleggert
Copy link
Collaborator

danieleggert commented Apr 17, 2020

This would reduce the need to use the .other case.

Here’s a list of commonly used capabilities:

ACL
ANNOTATE-EXPERIMENT-1
AUTH=ATOKEN
AUTH=PLAIN
AUTH=PTOKEN
AUTH=WETOKEN
AUTH=WSTOKEN
BINARY
CATENATE
CHILDREN
CONDSTORE
CONTEXT=SEARCH
CONTEXT=SORT
CREATE-SPECIAL-USE
ENABLE
ESEARCH
ESORT
ID
IDLE
IMAP4rev1
LANGUAGE
LIST-STATUS
LITERAL+
LOGIN-REFERRALS
METADATA
MULTISEARCH
NAMESPACE
QRESYNC
QUOTA
RIGHTS=tekx
SASL-IR
SEARCHRES
SORT
SORT=DISPLAY
SPECIAL-USE
STATUS=SIZE
THREAD=ORDEREDSUBJECT
THREAD=REFERENCES
UIDPLUS
UNSELECT
URL-PARTIAL
URLAUTH
UTF8=ACCEPT
WITHIN
XAPPLEPUSHSERVICE
XLIST
XSNIPPET=FUZZY
XUM1

Additionally, it’d be helpful to add an enum for common sub-values, e.g.

extension NIOIMAP {
    public enum Capability: Equatable {
        case auth(Auth)
        

        enum Auth: Equatable {
            case aToken
            case plain
            case pToken
            case weToken
            case wsToken
            case other(String)
        }
    }
}
@Davidde94 Davidde94 added the imap label Apr 20, 2020
@Davidde94
Copy link
Collaborator

Sounds like a good idea to me. To promote API stability we'll likely convert this to a struct but will provide convenience static functions for spec-defined capabilities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants