aboutsummaryrefslogtreecommitdiff
path: root/src/imap/command/selected.rs
diff options
context:
space:
mode:
authorQuentin <quentin@dufour.io>2024-02-23 17:32:38 +0000
committerQuentin <quentin@dufour.io>2024-02-23 17:32:38 +0000
commitd92ae5220cdaddf941da5a216fbd2c3549ccdec3 (patch)
tree464814294b6e50811e0c667cd1430c6855006f8a /src/imap/command/selected.rs
parent0bb7cdf696190200d1885ec822518ac45b685a9b (diff)
parent1ea3de30995b434c4e59123c1ab634d89a0274b5 (diff)
downloadaerogramme-d92ae5220cdaddf941da5a216fbd2c3549ccdec3.tar.gz
aerogramme-d92ae5220cdaddf941da5a216fbd2c3549ccdec3.zip
Merge pull request 'Perf measurement & bottleneck fix' (#102) from perf/cpu-ram-bottleneck into main0.2.2
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/aerogramme/pulls/102
Diffstat (limited to 'src/imap/command/selected.rs')
-rw-r--r--src/imap/command/selected.rs17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/imap/command/selected.rs b/src/imap/command/selected.rs
index 73f8aec..d000905 100644
--- a/src/imap/command/selected.rs
+++ b/src/imap/command/selected.rs
@@ -3,7 +3,7 @@ use std::sync::Arc;
use anyhow::Result;
use imap_codec::imap_types::command::{Command, CommandBody, FetchModifier, StoreModifier};
-use imap_codec::imap_types::core::Charset;
+use imap_codec::imap_types::core::{Charset, Vec1};
use imap_codec::imap_types::fetch::MacroOrMessageDataItemNames;
use imap_codec::imap_types::flag::{Flag, StoreResponse, StoreType};
use imap_codec::imap_types::mailbox::Mailbox as MailboxCodec;
@@ -54,11 +54,15 @@ pub async fn dispatch<'a>(
ctx.fetch(sequence_set, macro_or_item_names, modifiers, uid)
.await
}
+ //@FIXME SearchKey::And is a legacy hack, should be refactored
CommandBody::Search {
charset,
criteria,
uid,
- } => ctx.search(charset, criteria, uid).await,
+ } => {
+ ctx.search(charset, &SearchKey::And(criteria.clone()), uid)
+ .await
+ }
CommandBody::Expunge {
// UIDPLUS (rfc4315)
uid_sequence_set,
@@ -88,15 +92,6 @@ pub async fn dispatch<'a>(
// UNSELECT extension (rfc3691)
CommandBody::Unselect => ctx.unselect().await,
- // IDLE extension (rfc2177)
- CommandBody::Idle => Ok((
- Response::build()
- .to_req(ctx.req)
- .message("DUMMY command due to anti-pattern in the code")
- .ok()?,
- flow::Transition::Idle(ctx.req.tag.clone(), tokio::sync::Notify::new()),
- )),
-
// In selected mode, we fallback to authenticated when needed
_ => {
authenticated::dispatch(authenticated::AuthenticatedContext {