Browse Source

ui: pass search to libnotmuch for notmuch accounts

tags/alpha-0.4.1
Manos Pitsidianakis 2 months ago
parent
commit
b54bd6de84
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS. GPG Key ID: 73627C2F690DF710
1 changed files with 16 additions and 0 deletions
  1. +16
    -0
      ui/src/conf/accounts.rs

+ 16
- 0
ui/src/conf/accounts.rs View File

@@ -959,6 +959,22 @@ impl Account {
return crate::cache::imap_search(search_term, sort, folder_hash, &self.backend);
}

#[cfg(feature = "notmuch")]
{
if self.settings.account().format() == "notmuch" {
let backend_lck = self.backend.read().unwrap();
let b = (*backend_lck).as_any();
return if let Some(notmuch_backend) = b.downcast_ref::<melib::backends::NotmuchDb>()
{
notmuch_backend.search(search_term)
} else {
Err(MeliError::new(
"Internal error: Could not downcast backend to NotmuchDb",
))
};
}
}

#[cfg(feature = "sqlite3")]
{
crate::sqlite3::search(search_term, sort)


Loading…
Cancel
Save