From cbe842735e20f293a36a6c8d5e41667ca9787178 Mon Sep 17 00:00:00 2001 From: link2xt Date: Sat, 6 Dec 2025 04:21:31 +0000 Subject: [PATCH] api(rpc-client): add Chat.num_contacts() --- deltachat-rpc-client/src/deltachat_rpc_client/chat.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deltachat-rpc-client/src/deltachat_rpc_client/chat.py b/deltachat-rpc-client/src/deltachat_rpc_client/chat.py index dbfea9269..eef858b92 100644 --- a/deltachat-rpc-client/src/deltachat_rpc_client/chat.py +++ b/deltachat-rpc-client/src/deltachat_rpc_client/chat.py @@ -253,6 +253,10 @@ class Chat: contacts = self._rpc.get_chat_contacts(self.account.id, self.id) return [Contact(self.account, contact_id) for contact_id in contacts] + def num_contacts(self) -> int: + """Return number of contacts in this chat.""" + return len(self.get_contacts()) + def get_past_contacts(self) -> list[Contact]: """Get past contacts for this chat.""" past_contacts = self._rpc.get_past_chat_contacts(self.account.id, self.id)