migration to imap-flow seems done!
This commit is contained in:
parent
b66b9f75fe
commit
0cc13f891c
3 changed files with 19 additions and 6 deletions
|
@ -432,6 +432,7 @@ impl<'a> AuthenticatedContext<'a> {
|
||||||
Ok((
|
Ok((
|
||||||
Response::build()
|
Response::build()
|
||||||
.message("Select completed")
|
.message("Select completed")
|
||||||
|
.to_req(self.req)
|
||||||
.code(Code::ReadWrite)
|
.code(Code::ReadWrite)
|
||||||
.set_body(data)
|
.set_body(data)
|
||||||
.ok()?,
|
.ok()?,
|
||||||
|
|
|
@ -7,7 +7,7 @@ use imap_codec::imap_types::fetch::MacroOrMessageDataItemNames;
|
||||||
use imap_codec::imap_types::search::SearchKey;
|
use imap_codec::imap_types::search::SearchKey;
|
||||||
use imap_codec::imap_types::sequence::SequenceSet;
|
use imap_codec::imap_types::sequence::SequenceSet;
|
||||||
|
|
||||||
use crate::imap::command::anystate;
|
use crate::imap::command::{anystate, authenticated};
|
||||||
use crate::imap::flow;
|
use crate::imap::flow;
|
||||||
use crate::imap::mailbox_view::MailboxView;
|
use crate::imap::mailbox_view::MailboxView;
|
||||||
use crate::imap::response::Response;
|
use crate::imap::response::Response;
|
||||||
|
@ -48,8 +48,14 @@ pub async fn dispatch(ctx: ExaminedContext<'_>) -> Result<(Response<'static>, fl
|
||||||
flow::Transition::None,
|
flow::Transition::None,
|
||||||
)),
|
)),
|
||||||
|
|
||||||
// The command does not belong to this state
|
// In examined mode, we fallback to authenticated when needed
|
||||||
_ => anystate::wrong_state(ctx.req.tag.clone()),
|
_ => {
|
||||||
|
authenticated::dispatch(authenticated::AuthenticatedContext {
|
||||||
|
req: ctx.req,
|
||||||
|
user: ctx.user,
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ use imap_codec::imap_types::response::{Code, CodeOther};
|
||||||
use imap_codec::imap_types::search::SearchKey;
|
use imap_codec::imap_types::search::SearchKey;
|
||||||
use imap_codec::imap_types::sequence::SequenceSet;
|
use imap_codec::imap_types::sequence::SequenceSet;
|
||||||
|
|
||||||
use crate::imap::command::{anystate, MailboxName};
|
use crate::imap::command::{anystate, authenticated, MailboxName};
|
||||||
use crate::imap::flow;
|
use crate::imap::flow;
|
||||||
use crate::imap::mailbox_view::MailboxView;
|
use crate::imap::mailbox_view::MailboxView;
|
||||||
use crate::imap::response::Response;
|
use crate::imap::response::Response;
|
||||||
|
@ -59,8 +59,14 @@ pub async fn dispatch<'a>(
|
||||||
uid,
|
uid,
|
||||||
} => ctx.copy(sequence_set, mailbox, uid).await,
|
} => ctx.copy(sequence_set, mailbox, uid).await,
|
||||||
|
|
||||||
// The command does not belong to this state
|
// In selected mode, we fallback to authenticated when needed
|
||||||
_ => anystate::wrong_state(ctx.req.tag.clone()),
|
_ => {
|
||||||
|
authenticated::dispatch(authenticated::AuthenticatedContext {
|
||||||
|
req: ctx.req,
|
||||||
|
user: ctx.user,
|
||||||
|
})
|
||||||
|
.await
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue