diff options
author | Quentin <quentin@dufour.io> | 2024-01-06 10:38:37 +0000 |
---|---|---|
committer | Quentin <quentin@dufour.io> | 2024-01-06 10:38:37 +0000 |
commit | 44ca458c5cf666246e472dea9be70b745a130e8c (patch) | |
tree | b78cca747e5c2bc004cb93b93536623f7abb6ef5 /src/imap/command | |
parent | bcf6de83419b405fea95b740869f98d43586ea7c (diff) | |
parent | 53dbf82cbce3cb17cbcffd09558677faf8702f54 (diff) | |
download | aerogramme-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.rs | 2 | ||||
-rw-r--r-- | src/imap/command/selected.rs | 14 |
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(( |