Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions deltachat-rpc-client/src/deltachat_rpc_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ def is_configured(self) -> bool:

def configure(self, email: str, password: str, **kwargs) -> None:
"""Configure the client."""
self.account.set_config("addr", email)
self.account.set_config("mail_pw", password)
for key, value in kwargs.items():
self.account.set_config(key, value)
self.account.configure()
params = {"addr": email, "password": password}
self.account.add_or_update_transport(params)
self.logger.debug("Account configured")

def run_forever(self) -> None:
Expand Down
9 changes: 5 additions & 4 deletions deltachat-rpc-client/src/deltachat_rpc_client/pytestplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ def get_online_accounts(self, num: int) -> list[Account]:
def resetup_account(self, ac: Account) -> Account:
"""Resetup account from scratch, losing the encryption key."""
ac.stop_io()
ac_clone = self.get_unconfigured_account()
for i in ["addr", "mail_pw"]:
ac_clone.set_config(i, ac.get_config(i))
addr = ac.get_config("addr")
password = ac.get_config("mail_pw")
Comment on lines +76 to +77
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, this could use list_transports(), but it's fine not to do this now

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is still in login_param.rs:

    /// Saves entered account settings,
    /// so that they can be prefilled if the user wants to configure the server again.
    pub(crate) async fn save(&self, context: &Context) -> Result<()> {

and it's still needed by UIs until they switch to a list-transports screen, so, I think we'll anyways need to keep these configs for a bit.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #7342

ac.remove()
ac_clone.configure()
ac_clone = self.get_unconfigured_account()
params = {"addr": addr, "password": password}
ac_clone.add_or_update_transport(params)
return ac_clone

def get_accepted_chat(self, ac1: Account, ac2: Account) -> Chat:
Expand Down
8 changes: 2 additions & 6 deletions deltachat-rpc-client/tests/test_key_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ def test_autocrypt_setup_message_key_transfer(acfactory):
alice1 = acfactory.get_online_account()

alice2 = acfactory.get_unconfigured_account()
alice2.set_config("addr", alice1.get_config("addr"))
alice2.set_config("mail_pw", alice1.get_config("mail_pw"))
alice2.configure()
alice2.add_or_update_transport({"addr": alice1.get_config("addr"), "password": alice1.get_config("mail_pw")})
alice2.bring_online()

setup_code = alice1.initiate_autocrypt_key_transfer()
Expand All @@ -37,9 +35,7 @@ def test_ac_setup_message_twice(acfactory):
alice1 = acfactory.get_online_account()

alice2 = acfactory.get_unconfigured_account()
alice2.set_config("addr", alice1.get_config("addr"))
alice2.set_config("mail_pw", alice1.get_config("mail_pw"))
alice2.configure()
alice2.add_or_update_transport({"addr": alice1.get_config("addr"), "password": alice1.get_config("mail_pw")})
alice2.bring_online()

# Send the first Autocrypt Setup Message and ignore it.
Expand Down
Loading