aboutsummaryrefslogtreecommitdiff
path: root/src/imap/command/anystate.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/imap/command/anystate.rs')
-rw-r--r--src/imap/command/anystate.rs14
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))