diff options
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(( |