diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-03 12:29:19 +0100 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2024-01-03 12:29:19 +0100 |
commit | 6d37924399dd5d04f5be2506e3e044dd165f6399 (patch) | |
tree | 9d6030ed892dbf2518bf5fea5bd323ce9cfed6e8 /src/imap/command/anystate.rs | |
parent | a059585cb423d527763ef0131773d6620ebcafd5 (diff) | |
download | aerogramme-6d37924399dd5d04f5be2506e3e044dd165f6399.tar.gz aerogramme-6d37924399dd5d04f5be2506e3e044dd165f6399.zip |
rework capability
Diffstat (limited to 'src/imap/command/anystate.rs')
-rw-r--r-- | src/imap/command/anystate.rs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/imap/command/anystate.rs b/src/imap/command/anystate.rs index f326852..7d7c0b2 100644 --- a/src/imap/command/anystate.rs +++ b/src/imap/command/anystate.rs @@ -1,20 +1,16 @@ use anyhow::Result; -use imap_codec::imap_types::core::{NonEmptyVec, Tag}; -use imap_codec::imap_types::response::{Capability, Data}; +use imap_codec::imap_types::core::Tag; +use imap_codec::imap_types::response::Data; use crate::imap::flow; +use crate::imap::capability::ServerCapability; use crate::imap::response::Response; -pub(crate) fn capability(tag: Tag<'static>) -> Result<(Response<'static>, flow::Transition)> { - let capabilities: NonEmptyVec<Capability> = (vec![ - Capability::Imap4Rev1, - Capability::try_from("UNSELECT").unwrap(), - ]) - .try_into()?; +pub(crate) fn capability(tag: Tag<'static>, cap: &ServerCapability) -> Result<(Response<'static>, flow::Transition)> { let res = Response::build() .tag(tag) .message("Server capabilities") - .data(Data::Capability(capabilities)) + .data(Data::Capability(cap.to_vec())) .ok()?; Ok((res, flow::Transition::None)) |