diff options
Diffstat (limited to 'src/imap/command')
-rw-r--r-- | src/imap/command/authenticated.rs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/imap/command/authenticated.rs b/src/imap/command/authenticated.rs index ee7c8f3..1481a80 100644 --- a/src/imap/command/authenticated.rs +++ b/src/imap/command/authenticated.rs @@ -3,13 +3,13 @@ use std::sync::Arc; use anyhow::{anyhow, bail, Result}; use imap_codec::imap_types::command::{Command, CommandBody}; -use imap_codec::imap_types::core::{Atom, Literal, QuotedChar, NonEmptyVec}; +use imap_codec::imap_types::core::{Atom, Literal, NonEmptyVec, QuotedChar}; use imap_codec::imap_types::datetime::DateTime; +use imap_codec::imap_types::extensions::enable::CapabilityEnable; use imap_codec::imap_types::flag::{Flag, FlagNameAttribute}; use imap_codec::imap_types::mailbox::{ListMailbox, Mailbox as MailboxCodec}; use imap_codec::imap_types::response::{Code, CodeOther, Data}; use imap_codec::imap_types::status::{StatusDataItem, StatusDataItemName}; -use imap_codec::imap_types::extensions::enable::CapabilityEnable; use crate::imap::capability::{ClientCapability, ServerCapability}; use crate::imap::command::{anystate, MailboxName}; @@ -68,9 +68,7 @@ pub async fn dispatch<'a>( } => ctx.append(mailbox, flags, date, message).await, // rfc5161 ENABLE - CommandBody::Enable { capabilities } => { - ctx.enable(capabilities) - }, + CommandBody::Enable { capabilities } => ctx.enable(capabilities), // Collect other commands _ => anystate::wrong_state(ctx.req.tag.clone()), @@ -518,16 +516,17 @@ impl<'a> AuthenticatedContext<'a> { } } - fn enable(self, cap_enable: &NonEmptyVec<CapabilityEnable<'static>>) -> Result<(Response<'static>, flow::Transition)> { + fn enable( + self, + cap_enable: &NonEmptyVec<CapabilityEnable<'static>>, + ) -> Result<(Response<'static>, flow::Transition)> { let mut response_builder = Response::build().to_req(self.req); let capabilities = self.client_capabilities.try_enable(cap_enable.as_ref()); if capabilities.len() > 0 { response_builder = response_builder.data(Data::Enabled { capabilities }); } Ok(( - response_builder - .message("ENABLE completed") - .ok()?, + response_builder.message("ENABLE completed").ok()?, flow::Transition::None, )) } |