Skip to content

Commit a1e3ec1

Browse files
committed
feat: remove MvboxMove
1 parent 4b8ede9 commit a1e3ec1

14 files changed

Lines changed: 63 additions & 394 deletions

File tree

deltachat-ffi/deltachat.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,6 @@ char* dc_get_blobdir (const dc_context_t* context);
430430
* 1=send a copy of outgoing messages to self (default).
431431
* Sending messages to self is needed for a proper multi-account setup,
432432
* however, on the other hand, may lead to unwanted notifications in non-delta clients.
433-
* - `mvbox_move` = 1=detect chat messages,
434-
* move them to the `DeltaChat` folder,
435-
* and watch the `DeltaChat` folder for updates (default),
436-
* 0=do not move chat-messages
437433
* - `only_fetch_mvbox` = 1=Do not fetch messages from folders other than the
438434
* `DeltaChat` folder. Messages will still be fetched from the
439435
* spam folder.

deltachat-rpc-client/tests/test_folders.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -416,36 +416,26 @@ def test_mvbox_and_trash(acfactory, direct_imap, log):
416416

417417

418418
@pytest.mark.parametrize(
419-
("folder", "move", "expected_destination"),
419+
("folder", "expected_destination"),
420420
[
421421
(
422422
"xyz",
423-
False,
424423
"xyz",
425424
), # Test that emails aren't found in a random folder
426-
(
427-
"xyz",
428-
True,
429-
"xyz",
430-
), # ...emails are found in a random folder and downloaded without moving
431425
(
432426
"Spam",
433-
False,
434427
"INBOX",
435428
), # ...emails are moved from the spam folder to the Inbox
436429
],
437430
)
438431
# Testrun.org does not support the CREATE-SPECIAL-USE capability, which means that we can't create a folder with
439432
# the "\Junk" flag (see https://tools.ietf.org/html/rfc6154). So, we can't test spam folder detection by flag.
440-
def test_scan_folders(acfactory, log, direct_imap, folder, move, expected_destination):
433+
def test_scan_folders(acfactory, log, direct_imap, folder, expected_destination):
441434
"""Delta Chat periodically scans all folders for new messages to make sure we don't miss any."""
442-
variant = folder + "-" + str(move) + "-" + expected_destination
435+
variant = folder + "-" + expected_destination
443436
log.section("Testing variant " + variant)
444437
ac1, ac2 = acfactory.get_online_accounts(2)
445438
ac1.set_config("delete_server_after", "0")
446-
if move:
447-
ac1.set_config("mvbox_move", "1")
448-
ac1.bring_online()
449439

450440
ac1.stop_io()
451441
ac1_direct_imap = direct_imap(ac1)

deltachat-rpc-client/tests/test_multitransport.py

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,24 @@ def test_add_second_address(acfactory) -> None:
3131
account.delete_transport(second_addr)
3232
assert len(account.list_transports()) == 2
3333

34-
# Enabling mvbox_move or only_fetch_mvbox
34+
# Enabling only_fetch_mvbox
3535
# is not allowed when multi-transport is enabled.
36-
for option in ["mvbox_move", "only_fetch_mvbox"]:
37-
with pytest.raises(JsonRpcError):
38-
account.set_config(option, "1")
36+
with pytest.raises(JsonRpcError):
37+
account.set_config("only_fetch_mvbox", "1")
3938

4039
with pytest.raises(JsonRpcError):
4140
account.set_config("show_emails", "0")
4241

4342

44-
@pytest.mark.parametrize("key", ["mvbox_move", "only_fetch_mvbox"])
45-
def test_no_second_transport_with_mvbox(acfactory, key) -> None:
43+
def test_no_second_transport_with_mvbox(acfactory) -> None:
4644
"""Test that second transport cannot be configured if mvbox is used."""
4745
account = acfactory.new_configured_account()
4846
assert len(account.list_transports()) == 1
4947

50-
assert account.get_config("mvbox_move") == "0"
5148
assert account.get_config("only_fetch_mvbox") == "0"
5249

5350
qr = acfactory.get_account_qr()
54-
account.set_config(key, "1")
51+
account.set_config("only_fetch_mvbox", "1")
5552

5653
with pytest.raises(JsonRpcError):
5754
account.add_transport_from_qr(qr)
@@ -120,30 +117,6 @@ def test_change_address(acfactory) -> None:
120117
assert sender_addr2 == new_alice_addr
121118

122119

123-
@pytest.mark.parametrize("is_chatmail", ["0", "1"])
124-
def test_mvbox_move_first_transport(acfactory, is_chatmail) -> None:
125-
"""Test that mvbox_move is disabled by default even for non-chatmail accounts.
126-
Disabling mvbox_move is required to be able to setup a second transport.
127-
"""
128-
account = acfactory.get_unconfigured_account()
129-
130-
account.set_config("fix_is_chatmail", "1")
131-
account.set_config("is_chatmail", is_chatmail)
132-
133-
# The default value when the setting is unset is "1".
134-
# This is not changed for compatibility with old databases
135-
# imported from backups.
136-
assert account.get_config("mvbox_move") == "1"
137-
138-
qr = acfactory.get_account_qr()
139-
account.add_transport_from_qr(qr)
140-
141-
# Once the first transport is set up,
142-
# mvbox_move is disabled.
143-
assert account.get_config("mvbox_move") == "0"
144-
assert account.get_config("is_chatmail") == is_chatmail
145-
146-
147120
def test_reconfigure_transport(acfactory) -> None:
148121
"""Test that reconfiguring the transport works
149122
even if settings not supported for multi-transport

python/src/deltachat/testplugin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,6 @@ def prepare_account_from_liveconfig(self, configdict) -> Account:
522522
ac = self.get_unconfigured_account()
523523
assert "addr" in configdict and "mail_pw" in configdict, configdict
524524
configdict.setdefault("bcc_self", False)
525-
configdict.setdefault("mvbox_move", False)
526525
configdict.setdefault("sync_msgs", False)
527526
configdict.setdefault("delete_server_after", 0)
528527
ac.update_config(configdict)

python/tests/test_3_offline.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,19 +52,19 @@ def test_wrong_config_keys(self, acfactory):
5252

5353
def test_set_config_int_conversion(self, acfactory):
5454
ac1 = acfactory.get_unconfigured_account()
55-
ac1.set_config("mvbox_move", False)
56-
assert ac1.get_config("mvbox_move") == "0"
57-
ac1.set_config("mvbox_move", True)
58-
assert ac1.get_config("mvbox_move") == "1"
59-
ac1.set_config("mvbox_move", 0)
60-
assert ac1.get_config("mvbox_move") == "0"
61-
ac1.set_config("mvbox_move", 1)
62-
assert ac1.get_config("mvbox_move") == "1"
55+
ac1.set_config("bcc_self", False)
56+
assert ac1.get_config("bcc_self") == "0"
57+
ac1.set_config("bcc_self", True)
58+
assert ac1.get_config("bcc_self") == "1"
59+
ac1.set_config("bcc_self", 0)
60+
assert ac1.get_config("bcc_self") == "0"
61+
ac1.set_config("bcc_self", 1)
62+
assert ac1.get_config("bcc_self") == "1"
6363

6464
def test_update_config(self, acfactory):
6565
ac1 = acfactory.get_unconfigured_account()
66-
ac1.update_config({"mvbox_move": False})
67-
assert ac1.get_config("mvbox_move") == "0"
66+
ac1.update_config({"bcc_self": True})
67+
assert ac1.get_config("bcc_self") == "1"
6868

6969
def test_has_bccself(self, acfactory):
7070
ac1 = acfactory.get_unconfigured_account()

src/config.rs

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,6 @@ pub enum Config {
155155
#[strum(props(default = "1"))]
156156
MdnsEnabled,
157157

158-
/// True if chat messages should be moved to a separate folder. Auto-sent messages like sync
159-
/// ones are moved there anyway.
160-
#[strum(props(default = "1"))]
161-
MvboxMove,
162-
163158
/// Watch for new messages in the "Mvbox" (aka DeltaChat folder) only.
164159
///
165160
/// This will not entirely disable other folders, e.g. the spam folder will also still
@@ -478,7 +473,6 @@ impl Config {
478473
self,
479474
Self::Displayname
480475
| Self::MdnsEnabled
481-
| Self::MvboxMove
482476
| Self::ShowEmails
483477
| Self::Selfavatar
484478
| Self::Selfstatus,
@@ -487,10 +481,7 @@ impl Config {
487481

488482
/// Whether the config option needs an IO scheduler restart to take effect.
489483
pub(crate) fn needs_io_restart(&self) -> bool {
490-
matches!(
491-
self,
492-
Config::MvboxMove | Config::OnlyFetchMvbox | Config::ConfiguredAddr
493-
)
484+
matches!(self, Config::OnlyFetchMvbox | Config::ConfiguredAddr)
494485
}
495486
}
496487

@@ -608,8 +599,7 @@ impl Context {
608599

609600
/// Returns true if movebox ("DeltaChat" folder) should be watched.
610601
pub(crate) async fn should_watch_mvbox(&self) -> Result<bool> {
611-
Ok(self.get_config_bool(Config::MvboxMove).await?
612-
|| self.get_config_bool(Config::OnlyFetchMvbox).await?)
602+
self.get_config_bool(Config::OnlyFetchMvbox).await
613603
}
614604

615605
/// Returns true if sync messages should be sent.
@@ -693,7 +683,6 @@ impl Context {
693683
| Config::ProxyEnabled
694684
| Config::BccSelf
695685
| Config::MdnsEnabled
696-
| Config::MvboxMove
697686
| Config::OnlyFetchMvbox
698687
| Config::DeleteToTrash
699688
| Config::Configured
@@ -719,12 +708,7 @@ impl Context {
719708
Self::check_config(key, value)?;
720709

721710
let n_transports = self.count_transports().await?;
722-
if n_transports > 1
723-
&& matches!(
724-
key,
725-
Config::MvboxMove | Config::OnlyFetchMvbox | Config::ShowEmails
726-
)
727-
{
711+
if n_transports > 1 && matches!(key, Config::OnlyFetchMvbox | Config::ShowEmails) {
728712
bail!("Cannot reconfigure {key} when multiple transports are configured");
729713
}
730714

@@ -806,12 +790,6 @@ impl Context {
806790
.set_raw_config(key.as_ref(), value.map(|s| s.to_lowercase()).as_deref())
807791
.await?;
808792
}
809-
Config::MvboxMove => {
810-
self.sql.set_raw_config(key.as_ref(), value).await?;
811-
self.sql
812-
.set_raw_config(constants::DC_FOLDERS_CONFIGURED_KEY, None)
813-
.await?;
814-
}
815793
Config::ConfiguredAddr => {
816794
let Some(addr) = value else {
817795
bail!("Cannot unset configured_addr");

src/config/config_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,11 @@ async fn test_sync() -> Result<()> {
196196
sync(&alice0, &alice1).await;
197197
assert_eq!(alice1.get_config_bool(Config::MdnsEnabled).await?, false);
198198

199-
for key in [Config::ShowEmails, Config::MvboxMove] {
200-
let val = alice0.get_config_bool(key).await?;
201-
alice0.set_config_bool(key, !val).await?;
199+
{
200+
let val = alice0.get_config_bool(Config::ShowEmails).await?;
201+
alice0.set_config_bool(Config::ShowEmails, !val).await?;
202202
sync(&alice0, &alice1).await;
203-
assert_eq!(alice1.get_config_bool(key).await?, !val);
203+
assert_eq!(alice1.get_config_bool(Config::ShowEmails).await?, !val);
204204
}
205205

206206
// `Config::SyncMsgs` mustn't be synced.

src/configure.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,6 @@ impl Context {
281281
"To use additional relays, disable the legacy option \"Settings / Advanced / Only Fetch from DeltaChat Folder\"."
282282
);
283283
}
284-
if self.get_config(Config::MvboxMove).await?.as_deref() != Some("0") {
285-
bail!(
286-
"To use additional relays, disable the legacy option \"Settings / Advanced / Move automatically to DeltaChat Folder\"."
287-
);
288-
}
289284
if self.get_config(Config::ShowEmails).await?.as_deref() != Some("2") {
290285
bail!(
291286
"To use additional relays, set the legacy option \"Settings / Advanced / Show Classic Emails\" to \"All\"."

src/context.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,6 @@ impl Context {
864864
Err(err) => format!("<key failure: {err}>"),
865865
};
866866

867-
let mvbox_move = self.get_config_int(Config::MvboxMove).await?;
868867
let only_fetch_mvbox = self.get_config_int(Config::OnlyFetchMvbox).await?;
869868
let folders_configured = self
870869
.sql
@@ -960,7 +959,6 @@ impl Context {
960959
.await?
961960
.to_string(),
962961
);
963-
res.insert("mvbox_move", mvbox_move.to_string());
964962
res.insert("only_fetch_mvbox", only_fetch_mvbox.to_string());
965963
res.insert(
966964
constants::DC_FOLDERS_CONFIGURED_KEY,

0 commit comments

Comments
 (0)