Skip to content

Commit 396104a

Browse files
committed
feat: do not require ShowEmails to be set to All for adding second relay
1 parent 69f6727 commit 396104a

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

deltachat-rpc-client/tests/test_multitransport.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ def test_add_second_address(acfactory) -> None:
3838
with pytest.raises(JsonRpcError):
3939
account.set_config(option, "1")
4040

41-
with pytest.raises(JsonRpcError):
42-
account.set_config("show_emails", "0")
41+
# show_emails does not matter for multi-relay, can be set to anything
42+
account.set_config("show_emails", "0")
4343

4444

4545
@pytest.mark.parametrize("key", ["mvbox_move", "only_fetch_mvbox"])
@@ -58,8 +58,8 @@ def test_no_second_transport_with_mvbox(acfactory, key) -> None:
5858
account.add_transport_from_qr(qr)
5959

6060

61-
def test_no_second_transport_without_classic_emails(acfactory) -> None:
62-
"""Test that second transport cannot be configured if classic emails are not fetched."""
61+
def test_second_transport_without_classic_emails(acfactory) -> None:
62+
"""Test that second transport can be configured if classic emails are not fetched."""
6363
account = acfactory.new_configured_account()
6464
assert len(account.list_transports()) == 1
6565

@@ -68,8 +68,7 @@ def test_no_second_transport_without_classic_emails(acfactory) -> None:
6868
qr = acfactory.get_account_qr()
6969
account.set_config("show_emails", "0")
7070

71-
with pytest.raises(JsonRpcError):
72-
account.add_transport_from_qr(qr)
71+
account.add_transport_from_qr(qr)
7372

7473

7574
def test_change_address(acfactory) -> None:

src/config.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -712,12 +712,7 @@ impl Context {
712712
Self::check_config(key, value)?;
713713

714714
let n_transports = self.count_transports().await?;
715-
if n_transports > 1
716-
&& matches!(
717-
key,
718-
Config::MvboxMove | Config::OnlyFetchMvbox | Config::ShowEmails
719-
)
720-
{
715+
if n_transports > 1 && matches!(key, Config::MvboxMove | Config::OnlyFetchMvbox) {
721716
bail!("Cannot reconfigure {key} when multiple transports are configured");
722717
}
723718

src/configure.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,6 @@ impl Context {
286286
"To use additional relays, disable the legacy option \"Settings / Advanced / Move automatically to DeltaChat Folder\"."
287287
);
288288
}
289-
if self.get_config(Config::ShowEmails).await?.as_deref() != Some("2") {
290-
bail!(
291-
"To use additional relays, set the legacy option \"Settings / Advanced / Show Classic Emails\" to \"All\"."
292-
);
293-
}
294289

295290
if self
296291
.sql

0 commit comments

Comments
 (0)