deltachat-rpc-client 2.33.0__py3-none-any.whl → 2.35.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- deltachat_rpc_client/chat.py +12 -4
- {deltachat_rpc_client-2.33.0.dist-info → deltachat_rpc_client-2.35.0.dist-info}/METADATA +1 -1
- {deltachat_rpc_client-2.33.0.dist-info → deltachat_rpc_client-2.35.0.dist-info}/RECORD +7 -7
- {deltachat_rpc_client-2.33.0.dist-info → deltachat_rpc_client-2.35.0.dist-info}/WHEEL +0 -0
- {deltachat_rpc_client-2.33.0.dist-info → deltachat_rpc_client-2.35.0.dist-info}/entry_points.txt +0 -0
- {deltachat_rpc_client-2.33.0.dist-info → deltachat_rpc_client-2.35.0.dist-info}/licenses/LICENSE +0 -0
- {deltachat_rpc_client-2.33.0.dist-info → deltachat_rpc_client-2.35.0.dist-info}/top_level.txt +0 -0
deltachat_rpc_client/chat.py
CHANGED
|
@@ -219,10 +219,12 @@ class Chat:
|
|
|
219
219
|
"""Mark all messages in this chat as noticed."""
|
|
220
220
|
self._rpc.marknoticed_chat(self.account.id, self.id)
|
|
221
221
|
|
|
222
|
-
def add_contact(self, *contact: Union[int, str, Contact]) -> None:
|
|
222
|
+
def add_contact(self, *contact: Union[int, str, Contact, "Account"]) -> None:
|
|
223
223
|
"""Add contacts to this group."""
|
|
224
|
+
from .account import Account
|
|
225
|
+
|
|
224
226
|
for cnt in contact:
|
|
225
|
-
if isinstance(cnt, str):
|
|
227
|
+
if isinstance(cnt, (str, Account)):
|
|
226
228
|
contact_id = self.account.create_contact(cnt).id
|
|
227
229
|
elif not isinstance(cnt, int):
|
|
228
230
|
contact_id = cnt.id
|
|
@@ -230,10 +232,12 @@ class Chat:
|
|
|
230
232
|
contact_id = cnt
|
|
231
233
|
self._rpc.add_contact_to_chat(self.account.id, self.id, contact_id)
|
|
232
234
|
|
|
233
|
-
def remove_contact(self, *contact: Union[int, str, Contact]) -> None:
|
|
235
|
+
def remove_contact(self, *contact: Union[int, str, Contact, "Account"]) -> None:
|
|
234
236
|
"""Remove members from this group."""
|
|
237
|
+
from .account import Account
|
|
238
|
+
|
|
235
239
|
for cnt in contact:
|
|
236
|
-
if isinstance(cnt, str):
|
|
240
|
+
if isinstance(cnt, (str, Account)):
|
|
237
241
|
contact_id = self.account.create_contact(cnt).id
|
|
238
242
|
elif not isinstance(cnt, int):
|
|
239
243
|
contact_id = cnt.id
|
|
@@ -249,6 +253,10 @@ class Chat:
|
|
|
249
253
|
contacts = self._rpc.get_chat_contacts(self.account.id, self.id)
|
|
250
254
|
return [Contact(self.account, contact_id) for contact_id in contacts]
|
|
251
255
|
|
|
256
|
+
def num_contacts(self) -> int:
|
|
257
|
+
"""Return number of contacts in this chat."""
|
|
258
|
+
return len(self.get_contacts())
|
|
259
|
+
|
|
252
260
|
def get_past_contacts(self) -> list[Contact]:
|
|
253
261
|
"""Get past contacts for this chat."""
|
|
254
262
|
past_contacts = self._rpc.get_past_chat_contacts(self.account.id, self.id)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
deltachat_rpc_client/__init__.py,sha256=zroJARiq9HBi7Ln03KlICOUJHSjm3CGIFkHfXILEdOQ,567
|
|
2
2
|
deltachat_rpc_client/_utils.py,sha256=v0iWVSa6S-s078GgnnhflCRhA9pfWI-CfK8mjZ4zjXc,6393
|
|
3
3
|
deltachat_rpc_client/account.py,sha256=CNUwmWNdWlaEXuDHy0Xld7EFnNaBrMk_BORkVeNIql4,19549
|
|
4
|
-
deltachat_rpc_client/chat.py,sha256=
|
|
4
|
+
deltachat_rpc_client/chat.py,sha256=NWFekpJaHh21GLNev0_5YhbPLPz72TTwXlmJ8fDAfgk,11957
|
|
5
5
|
deltachat_rpc_client/client.py,sha256=6eP_lH5z7G5Sy7vDRNfKNY3dkUqJqKZDVyCGjynsuW8,7181
|
|
6
6
|
deltachat_rpc_client/const.py,sha256=fnM377RkqOf4rM_jhy-O8dK-MbFLXQYtvprsvVWg2YI,6722
|
|
7
7
|
deltachat_rpc_client/contact.py,sha256=NLh1XNnD_LQf27pNcVgqNN97Gbv190VSCuEyjjce4L4,1893
|
|
@@ -11,9 +11,9 @@ deltachat_rpc_client/message.py,sha256=xA3rLUOPkakqr7kW3JORVYLKHQxvggBqgrXPnDK1a
|
|
|
11
11
|
deltachat_rpc_client/py.typed,sha256=nGQ9Itq-bkXBn5Ri1JIR0oYnDNv7LDRfkowxBSSqVTM,60
|
|
12
12
|
deltachat_rpc_client/pytestplugin.py,sha256=ptQg9BMtNqTmFY3-InFVMRmeRqQBGym7wgdORSaOEk0,10804
|
|
13
13
|
deltachat_rpc_client/rpc.py,sha256=V26Z6rSjwAIWinPft5jnJIQrQg6lnlqLVf9BPWgz6iE,6318
|
|
14
|
-
deltachat_rpc_client-2.
|
|
15
|
-
deltachat_rpc_client-2.
|
|
16
|
-
deltachat_rpc_client-2.
|
|
17
|
-
deltachat_rpc_client-2.
|
|
18
|
-
deltachat_rpc_client-2.
|
|
19
|
-
deltachat_rpc_client-2.
|
|
14
|
+
deltachat_rpc_client-2.35.0.dist-info/licenses/LICENSE,sha256=Pz2eACSxkhsGfW9_iN60pgy-enjnbGTj8df8O3ebnQQ,16726
|
|
15
|
+
deltachat_rpc_client-2.35.0.dist-info/METADATA,sha256=0xwLHNsmZzyP6UzKB4UUMztne273VtzX9X0Miq0Zoyw,2274
|
|
16
|
+
deltachat_rpc_client-2.35.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
17
|
+
deltachat_rpc_client-2.35.0.dist-info/entry_points.txt,sha256=VHpX6EnKBaNj89qJWctApThnMa8suyaamfZEnQacXgc,81
|
|
18
|
+
deltachat_rpc_client-2.35.0.dist-info/top_level.txt,sha256=ePNMkY10htGrLiLydH1ITvYFM3LcTEa51HyPqJ40hDk,21
|
|
19
|
+
deltachat_rpc_client-2.35.0.dist-info/RECORD,,
|
|
File without changes
|
{deltachat_rpc_client-2.33.0.dist-info → deltachat_rpc_client-2.35.0.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{deltachat_rpc_client-2.33.0.dist-info → deltachat_rpc_client-2.35.0.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{deltachat_rpc_client-2.33.0.dist-info → deltachat_rpc_client-2.35.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|