From 03bb751a9bf18f612078f87cc2702a447169ee93 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 7 Apr 2024 19:47:26 +0000 Subject: [PATCH] api(deltachat-rpc-client): add Account.create_chat() --- deltachat-rpc-client/src/deltachat_rpc_client/account.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/account.py b/deltachat-rpc-client/src/deltachat_rpc_client/account.py index 25b78bf7d..2dfb7236c 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/account.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/account.py @@ -104,6 +104,11 @@ class Account: obj = obj.get_snapshot().address return Contact(self, self._rpc.create_contact(self.id, obj, name)) + def create_chat(self, account: "Account") -> Chat: + addr = account.get_config("addr") + contact = self.create_contact(addr) + return contact.create_chat() + def get_contact_by_id(self, contact_id: int) -> Contact: """Return Contact instance for the given contact ID.""" return Contact(self, contact_id)