mirror of
https://github.com/pimalaya/himalaya.git
synced 2026-06-20 07:28:26 +08:00
improve backend features management for every command
This commit is contained in:
@@ -101,7 +101,7 @@ impl AccountSyncCommand {
|
||||
let account_name = account_config.name.as_str();
|
||||
|
||||
let backend_builder =
|
||||
BackendBuilder::new(toml_account_config, account_config.clone(), false).await?;
|
||||
BackendBuilder::new(toml_account_config, account_config.clone()).await?;
|
||||
let sync_builder = AccountSyncBuilder::new(backend_builder.into())
|
||||
.await?
|
||||
.with_some_folders_strategy(strategy)
|
||||
|
||||
@@ -111,6 +111,14 @@ impl TomlAccountConfig {
|
||||
.or_else(|| self.backend.as_ref())
|
||||
}
|
||||
|
||||
pub fn watch_envelopes_kind(&self) -> Option<&BackendKind> {
|
||||
self.envelope
|
||||
.as_ref()
|
||||
.and_then(|envelope| envelope.watch.as_ref())
|
||||
.and_then(|watch| watch.backend.as_ref())
|
||||
.or_else(|| self.backend.as_ref())
|
||||
}
|
||||
|
||||
pub fn add_flags_kind(&self) -> Option<&BackendKind> {
|
||||
self.flag
|
||||
.as_ref()
|
||||
|
||||
Reference in New Issue
Block a user