diff --git a/CHANGELOG.md b/CHANGELOG.md index 90c6ee9db..6c44fd281 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## Unreleased + +### API changes + +- Removed `mvbox_watch` option. #2906 + It is automatically enabled whenever `mvbox_move` is enabled. + ## 1.70.0 ### Fixes diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index b68d8d7c4..c7bd07a25 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -299,12 +299,11 @@ char* dc_get_blobdir (const dc_context_t* context); * - `sentbox_watch`= 1=watch `Sent`-folder for changes (default), * 0=do not watch the `Sent`-folder, * changes require restarting IO by calling dc_stop_io() and then dc_start_io(). - * - `mvbox_watch` = 1=watch `DeltaChat`-folder for changes (default), - * 0=do not watch the `DeltaChat`-folder, - * changes require restarting IO by calling dc_stop_io() and then dc_start_io(). - * - `mvbox_move` = 1=heuristically detect chat-messages - * and move them to the `DeltaChat`-folder, + * - `mvbox_move` = 1=detect chat messages, + * move them to the `DeltaChat` folder, + * and watch the `DeltaChat` folder for updates (default), * 0=do not move chat-messages + * changes require restarting IO by calling dc_stop_io() and then dc_start_io(). * - `show_emails` = DC_SHOW_EMAILS_OFF (0)= * show direct replies to chats only (default), * DC_SHOW_EMAILS_ACCEPTED_CONTACTS (1)= diff --git a/python/src/deltachat/__init__.py b/python/src/deltachat/__init__.py index 88a4566c0..52ca63fc7 100644 --- a/python/src/deltachat/__init__.py +++ b/python/src/deltachat/__init__.py @@ -75,7 +75,6 @@ def run_cmdline(argv=None, account_plugins=None): ac.set_config("addr", args.email) ac.set_config("mail_pw", args.password) ac.set_config("mvbox_move", "0") - ac.set_config("mvbox_watch", "0") ac.set_config("sentbox_watch", "0") ac.set_config("bot", "1") configtracker = ac.configure() diff --git a/python/src/deltachat/testplugin.py b/python/src/deltachat/testplugin.py index e172e3e32..7ed48f96a 100644 --- a/python/src/deltachat/testplugin.py +++ b/python/src/deltachat/testplugin.py @@ -303,21 +303,20 @@ def acfactory(pytestconfig, tmpdir, request, session_liveconfig, data): self._preconfigure_key(ac, configdict['addr']) return ac, dict(configdict) - def get_online_configuring_account(self, mvbox=False, sentbox=False, move=False, + def get_online_configuring_account(self, sentbox=False, move=False, pre_generated_key=True, quiet=False, config={}): ac, configdict = self.get_online_config( pre_generated_key=pre_generated_key, quiet=quiet) configdict.update(config) - configdict["mvbox_watch"] = str(int(mvbox)) configdict["mvbox_move"] = str(int(move)) configdict["sentbox_watch"] = str(int(sentbox)) ac.update_config(configdict) ac._configtracker = ac.configure() return ac - def get_one_online_account(self, pre_generated_key=True, mvbox=False, move=False): + def get_one_online_account(self, pre_generated_key=True, move=False): ac1 = self.get_online_configuring_account( - pre_generated_key=pre_generated_key, mvbox=mvbox, move=move) + pre_generated_key=pre_generated_key, move=move) self.wait_configure_and_start_io([ac1]) return ac1 @@ -336,7 +335,7 @@ def acfactory(pytestconfig, tmpdir, request, session_liveconfig, data): return accounts def clone_online_account(self, account, pre_generated_key=True): - """ Clones addr, mail_pw, mvbox_watch, mvbox_move, sentbox_watch and the + """ Clones addr, mail_pw, mvbox_move, sentbox_watch and the direct_imap object of an online account. This simulates the user setting up a new device without importing a backup. @@ -351,7 +350,6 @@ def acfactory(pytestconfig, tmpdir, request, session_liveconfig, data): ac.update_config(dict( addr=account.get_config("addr"), mail_pw=account.get_config("mail_pw"), - mvbox_watch=account.get_config("mvbox_watch"), mvbox_move=account.get_config("mvbox_move"), sentbox_watch=account.get_config("sentbox_watch"), )) diff --git a/python/tests/test_account.py b/python/tests/test_account.py index 470a67e3f..2480695c8 100644 --- a/python/tests/test_account.py +++ b/python/tests/test_account.py @@ -860,7 +860,7 @@ class TestOnlineAccount: def test_mvbox_sentbox_threads(self, acfactory, lp): lp.sec("ac1: start with mvbox thread") - ac1 = acfactory.get_online_configuring_account(mvbox=True, move=True, sentbox=True) + ac1 = acfactory.get_online_configuring_account(move=True, sentbox=True) lp.sec("ac2: start without mvbox/sentbox threads") ac2 = acfactory.get_online_configuring_account() @@ -874,7 +874,7 @@ class TestOnlineAccount: def test_move_works(self, acfactory): ac1 = acfactory.get_online_configuring_account() - ac2 = acfactory.get_online_configuring_account(mvbox=True, move=True) + ac2 = acfactory.get_online_configuring_account(move=True) acfactory.wait_configure_and_start_io() chat = acfactory.get_accepted_chat(ac1, ac2) chat.send_text("message1") @@ -883,7 +883,7 @@ class TestOnlineAccount: ac2._evtracker.get_matching("DC_EVENT_IMAP_MESSAGE_MOVED") def test_move_works_on_self_sent(self, acfactory): - ac1 = acfactory.get_online_configuring_account(mvbox=True, move=True) + ac1 = acfactory.get_online_configuring_account(move=True) ac2 = acfactory.get_online_configuring_account() acfactory.wait_configure_and_start_io() ac1.set_config("bcc_self", "1") @@ -953,7 +953,7 @@ class TestOnlineAccount: assert msg_in.is_forwarded() def test_send_self_message(self, acfactory, lp): - ac1 = acfactory.get_one_online_account(mvbox=True, move=True) + ac1 = acfactory.get_one_online_account(move=True) lp.sec("ac1: create self chat") chat = ac1.get_self_contact().create_chat() chat.send_text("hello") @@ -1034,7 +1034,7 @@ class TestOnlineAccount: def test_moved_markseen(self, acfactory, lp): """Test that message already moved to DeltaChat folder is marked as seen.""" - ac1 = acfactory.get_online_configuring_account(mvbox=True, config={"inbox_watch": "0"}) + ac1 = acfactory.get_online_configuring_account(move=True, config={"inbox_watch": "0"}) ac2 = acfactory.get_online_configuring_account() acfactory.wait_configure_and_start_io([ac1, ac2]) ac1.set_config("bcc_self", "1") @@ -1095,8 +1095,8 @@ class TestOnlineAccount: def test_markseen_message_and_mdn(self, acfactory, mvbox_move): # Please only change this test if you are very sure that it will still catch the issues it catches now. # We had so many problems with markseen, if in doubt, rather create another test, it can't harm. - ac1 = acfactory.get_online_configuring_account(move=mvbox_move, mvbox=mvbox_move) - ac2 = acfactory.get_online_configuring_account(move=mvbox_move, mvbox=mvbox_move) + ac1 = acfactory.get_online_configuring_account(move=mvbox_move) + ac2 = acfactory.get_online_configuring_account(move=mvbox_move) acfactory.wait_configure_and_start_io() # Do not send BCC to self, we only want to test MDN on ac1. @@ -2349,7 +2349,7 @@ class TestOnlineAccount: def test_immediate_autodelete(self, acfactory, lp): ac1 = acfactory.get_online_configuring_account() - ac2 = acfactory.get_online_configuring_account(mvbox=False, move=False, sentbox=False) + ac2 = acfactory.get_online_configuring_account(move=False, sentbox=False) # "1" means delete immediately, while "0" means do not delete ac2.set_config("delete_server_after", "1") @@ -2677,7 +2677,7 @@ class TestOnlineAccount: if mvbox_move: assert ac.get_config("configured_mvbox_folder") - ac1 = acfactory.get_online_configuring_account(mvbox=mvbox_move, move=mvbox_move) + ac1 = acfactory.get_online_configuring_account(move=mvbox_move) ac1.set_config("sentbox_move", "1") ac2 = acfactory.get_online_configuring_account() @@ -2777,7 +2777,7 @@ class TestOnlineAccount: def test_delete_deltachat_folder(self, acfactory): """Test that DeltaChat folder is recreated if user deletes it manually.""" - ac1 = acfactory.get_online_configuring_account(mvbox=True) + ac1 = acfactory.get_online_configuring_account(move=True) ac2 = acfactory.get_online_configuring_account() acfactory.wait_configure(ac1) diff --git a/src/config.rs b/src/config.rs index a0cd9d76b..b9653d3e6 100644 --- a/src/config.rs +++ b/src/config.rs @@ -73,9 +73,6 @@ pub enum Config { #[strum(props(default = "1"))] SentboxWatch, - #[strum(props(default = "1"))] - MvboxWatch, - #[strum(props(default = "1"))] MvboxMove, diff --git a/src/configure.rs b/src/configure.rs index 358fbcc16..b726caf00 100644 --- a/src/configure.rs +++ b/src/configure.rs @@ -443,8 +443,7 @@ async fn configure(ctx: &Context, param: &mut LoginParam) -> Result<()> { progress!(ctx, 900); - let create_mvbox = ctx.get_config_bool(Config::MvboxWatch).await? - || ctx.get_config_bool(Config::MvboxMove).await?; + let create_mvbox = ctx.get_config_bool(Config::MvboxMove).await?; imap.configure_folders(ctx, create_mvbox).await?; diff --git a/src/context.rs b/src/context.rs index 4b674fcb1..2a4ea1e08 100644 --- a/src/context.rs +++ b/src/context.rs @@ -324,7 +324,6 @@ impl Context { let inbox_watch = self.get_config_int(Config::InboxWatch).await?; let sentbox_watch = self.get_config_int(Config::SentboxWatch).await?; - let mvbox_watch = self.get_config_int(Config::MvboxWatch).await?; let mvbox_move = self.get_config_int(Config::MvboxMove).await?; let sentbox_move = self.get_config_int(Config::SentboxMove).await?; let folders_configured = self @@ -383,7 +382,6 @@ impl Context { ); res.insert("inbox_watch", inbox_watch.to_string()); res.insert("sentbox_watch", sentbox_watch.to_string()); - res.insert("mvbox_watch", mvbox_watch.to_string()); res.insert("mvbox_move", mvbox_move.to_string()); res.insert("sentbox_move", sentbox_move.to_string()); res.insert("folders_configured", folders_configured.to_string()); diff --git a/src/imap/scan_folders.rs b/src/imap/scan_folders.rs index 5c2df7cd9..0adaa1b70 100644 --- a/src/imap/scan_folders.rs +++ b/src/imap/scan_folders.rs @@ -106,7 +106,7 @@ pub(crate) async fn get_watched_folders(context: &Context) -> Vec { let mut res = Vec::new(); let folder_watched_configured = &[ (Config::SentboxWatch, Config::ConfiguredSentboxFolder), - (Config::MvboxWatch, Config::ConfiguredMvboxFolder), + (Config::MvboxMove, Config::ConfiguredMvboxFolder), (Config::InboxWatch, Config::ConfiguredInboxFolder), ]; for (watched, configured) in folder_watched_configured { diff --git a/src/provider/data.rs b/src/provider/data.rs index a61d99eed..9bca034bc 100644 --- a/src/provider/data.rs +++ b/src/provider/data.rs @@ -328,10 +328,6 @@ static P_DUBBY_ORG: Lazy = Lazy::new(|| Provider { key: Config::SentboxWatch, value: "0", }, - ConfigDefault { - key: Config::MvboxWatch, - value: "0", - }, ConfigDefault { key: Config::MvboxMove, value: "0", @@ -475,10 +471,6 @@ static P_FIVE_CHAT: Lazy = Lazy::new(|| Provider { key: Config::SentboxWatch, value: "0", }, - ConfigDefault { - key: Config::MvboxWatch, - value: "0", - }, ConfigDefault { key: Config::MvboxMove, value: "0", @@ -823,10 +815,6 @@ static P_NAUTA_CU: Lazy = Lazy::new(|| Provider { key: Config::SentboxWatch, value: "0", }, - ConfigDefault { - key: Config::MvboxWatch, - value: "0", - }, ConfigDefault { key: Config::MvboxMove, value: "0", @@ -1101,10 +1089,6 @@ static P_TESTRUN: Lazy = Lazy::new(|| Provider { key: Config::SentboxWatch, value: "0", }, - ConfigDefault { - key: Config::MvboxWatch, - value: "0", - }, ConfigDefault { key: Config::MvboxMove, value: "0", diff --git a/src/scheduler.rs b/src/scheduler.rs index bd9065ff2..8d64795d1 100644 --- a/src/scheduler.rs +++ b/src/scheduler.rs @@ -353,7 +353,7 @@ impl Scheduler { })) }; - if ctx.get_config_bool(Config::MvboxWatch).await? { + if ctx.get_config_bool(Config::MvboxMove).await? { let ctx = ctx.clone(); mvbox_handle = Some(task::spawn(async move { simple_imap_loop( diff --git a/src/scheduler/connectivity.rs b/src/scheduler/connectivity.rs index 50938ab40..e8ba2e8d5 100644 --- a/src/scheduler/connectivity.rs +++ b/src/scheduler/connectivity.rs @@ -367,7 +367,7 @@ impl Context { ), ( Config::ConfiguredMvboxFolder, - Config::MvboxWatch, + Config::MvboxMove, mvbox.state.connectivity.clone(), ), (