aboutsummaryrefslogtreecommitdiff
path: root/src/imap/command/examined.rs
diff options
context:
space:
mode:
authorQuentin <quentin@dufour.io>2024-01-08 10:39:26 +0000
committerQuentin <quentin@dufour.io>2024-01-08 10:39:26 +0000
commitd7788e29a8a64550e9b274001ff3fb9a7bf3473b (patch)
treee43a11753472f1917ce4aa6ddba24ae3a513bd50 /src/imap/command/examined.rs
parent152d5b7604337fe19a7aea7fc37b3d4615ca7393 (diff)
parent42a54b2c500294c594f3efdd25db28c18f5ac238 (diff)
downloadaerogramme-d7788e29a8a64550e9b274001ff3fb9a7bf3473b.tar.gz
aerogramme-d7788e29a8a64550e9b274001ff3fb9a7bf3473b.zip
Merge pull request 'Implement search' (#61) from feat/search into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/aerogramme/pulls/61
Diffstat (limited to 'src/imap/command/examined.rs')
-rw-r--r--src/imap/command/examined.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/imap/command/examined.rs b/src/imap/command/examined.rs
index ec16973..3dd11e2 100644
--- a/src/imap/command/examined.rs
+++ b/src/imap/command/examined.rs
@@ -111,15 +111,17 @@ impl<'a> ExaminedContext<'a> {
pub async fn search(
self,
- _charset: &Option<Charset<'a>>,
- _criteria: &SearchKey<'a>,
- _uid: &bool,
+ charset: &Option<Charset<'a>>,
+ criteria: &SearchKey<'a>,
+ uid: &bool,
) -> Result<(Response<'static>, flow::Transition)> {
+ let found = self.mailbox.search(charset, criteria, *uid).await?;
Ok((
Response::build()
.to_req(self.req)
- .message("Not implemented")
- .bad()?,
+ .set_body(found)
+ .message("SEARCH completed")
+ .ok()?,
flow::Transition::None,
))
}