aboutsummaryrefslogtreecommitdiff
path: root/src/imap/command
diff options
context:
space:
mode:
authorQuentin <quentin@dufour.io>2024-01-06 10:38:37 +0000
committerQuentin <quentin@dufour.io>2024-01-06 10:38:37 +0000
commit44ca458c5cf666246e472dea9be70b745a130e8c (patch)
treeb78cca747e5c2bc004cb93b93536623f7abb6ef5 /src/imap/command
parentbcf6de83419b405fea95b740869f98d43586ea7c (diff)
parent53dbf82cbce3cb17cbcffd09558677faf8702f54 (diff)
downloadaerogramme-44ca458c5cf666246e472dea9be70b745a130e8c.tar.gz
aerogramme-44ca458c5cf666246e472dea9be70b745a130e8c.zip
Merge pull request 'Aerogramme refactoring' (#57) from feat/more-imap-qol into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/aerogramme/pulls/57
Diffstat (limited to 'src/imap/command')
-rw-r--r--src/imap/command/examined.rs2
-rw-r--r--src/imap/command/selected.rs14
2 files changed, 9 insertions, 7 deletions
diff --git a/src/imap/command/examined.rs b/src/imap/command/examined.rs
index 0d688c0..ec16973 100644
--- a/src/imap/command/examined.rs
+++ b/src/imap/command/examined.rs
@@ -125,7 +125,7 @@ impl<'a> ExaminedContext<'a> {
}
pub async fn noop(self) -> Result<(Response<'static>, flow::Transition)> {
- self.mailbox.mailbox.force_sync().await?;
+ self.mailbox.0.mailbox.force_sync().await?;
let updates = self.mailbox.update().await?;
Ok((
diff --git a/src/imap/command/selected.rs b/src/imap/command/selected.rs
index c8cc680..35c3eb4 100644
--- a/src/imap/command/selected.rs
+++ b/src/imap/command/selected.rs
@@ -136,21 +136,23 @@ impl<'a> SelectedContext<'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,
))
}
pub async fn noop(self) -> Result<(Response<'static>, flow::Transition)> {
- self.mailbox.mailbox.force_sync().await?;
+ self.mailbox.0.mailbox.force_sync().await?;
let updates = self.mailbox.update().await?;
Ok((