jsonrpc: auto restart io on setConfig for the following keys sentbox_watch, mvbox_move and only_fetch_mvbox (#3542)

Co-authored-by: Jikstra <34889164+Jikstra@users.noreply.github.com>
This commit is contained in:
Simon Laux
2022-08-18 16:27:03 +02:00
committed by GitHub
parent 8be5ca6c30
commit 7d97ab2731
3 changed files with 22 additions and 2 deletions

View File

@@ -671,11 +671,19 @@ async fn set_config(
value: Option<&str>,
) -> Result<(), anyhow::Error> {
if key.starts_with("ui.") {
ctx.set_ui_config(key, value).await
ctx.set_ui_config(key, value).await?;
} else {
ctx.set_config(Config::from_str(key).context("unknown key")?, value)
.await
.await?;
match key {
"sentbox_watch" | "mvbox_move" | "only_fetch_mvbox" => {
ctx.restart_io_if_running().await;
}
_ => {}
}
}
Ok(())
}
async fn get_config(