diff options
author | Quentin <quentin@dufour.io> | 2024-01-04 11:11:01 +0000 |
---|---|---|
committer | Quentin <quentin@dufour.io> | 2024-01-04 11:11:01 +0000 |
commit | bcf6de83419b405fea95b740869f98d43586ea7c (patch) | |
tree | 9f52832b90685913beda8f1bf19a22b2ec7bc6c6 /src/imap/command/anystate.rs | |
parent | b9a0c1e6eced036eb71e8221a4f236f72832fec2 (diff) | |
parent | 7ae9966675c85b34f1a99d81062b44b74385a15b (diff) | |
download | aerogramme-bcf6de83419b405fea95b740869f98d43586ea7c.tar.gz aerogramme-bcf6de83419b405fea95b740869f98d43586ea7c.zip |
Merge pull request 'Implement some IMAP extensions' (#50) from feat/more-ext into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/aerogramme/pulls/50
Diffstat (limited to 'src/imap/command/anystate.rs')
-rw-r--r-- | src/imap/command/anystate.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/imap/command/anystate.rs b/src/imap/command/anystate.rs index 42fe645..718ba3f 100644 --- a/src/imap/command/anystate.rs +++ b/src/imap/command/anystate.rs @@ -1,17 +1,19 @@ 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::capability::ServerCapability; use crate::imap::flow; 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::Idle]).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)) |