deltachat-rpc-client 1.159.5__py3-none-any.whl → 2.0.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.
@@ -211,8 +211,8 @@ class Account:
211
211
  def get_contacts(
212
212
  self,
213
213
  query: Optional[str] = None,
214
+ *,
214
215
  with_self: bool = False,
215
- verified_only: bool = False,
216
216
  snapshot: bool = False,
217
217
  ) -> Union[list[Contact], list[AttrDict]]:
218
218
  """Get a filtered list of contacts.
@@ -220,12 +220,9 @@ class Account:
220
220
  :param query: if a string is specified, only return contacts
221
221
  whose name or e-mail matches query.
222
222
  :param with_self: if True the self-contact is also included if it matches the query.
223
- :param only_verified: if True only return verified contacts.
224
223
  :param snapshot: If True return a list of contact snapshots instead of Contact instances.
225
224
  """
226
225
  flags = 0
227
- if verified_only:
228
- flags |= ContactFlag.VERIFIED_ONLY
229
226
  if with_self:
230
227
  flags |= ContactFlag.ADD_SELF
231
228
 
@@ -291,10 +288,46 @@ class Account:
291
288
  def create_group(self, name: str, protect: bool = False) -> Chat:
292
289
  """Create a new group chat.
293
290
 
294
- After creation, the group has only self-contact as member and is in unpromoted state.
291
+ After creation,
292
+ the group has only self-contact as member one member (see `SpecialContactId.SELF`)
293
+ and is in _unpromoted_ state.
294
+ This means, you can add or remove members, change the name,
295
+ the group image and so on without messages being sent to all group members.
296
+
297
+ This changes as soon as the first message is sent to the group members
298
+ and the group becomes _promoted_.
299
+ After that, all changes are synced with all group members
300
+ by sending status message.
301
+
302
+ To check, if a chat is still unpromoted, you can look at the `is_unpromoted` property of a chat
303
+ (see `get_full_snapshot()` / `get_basic_snapshot()`).
304
+ This may be useful if you want to show some help for just created groups.
305
+
306
+ :param protect: If set to 1 the function creates group with protection initially enabled.
307
+ Only verified members are allowed in these groups
308
+ and end-to-end-encryption is always enabled.
295
309
  """
296
310
  return Chat(self, self._rpc.create_group_chat(self.id, name, protect))
297
311
 
312
+ def create_broadcast(self, name: str) -> Chat:
313
+ """Create a new **broadcast channel**
314
+ (called "Channel" in the UI).
315
+
316
+ Broadcast channels are similar to groups on the sending device,
317
+ however, recipients get the messages in a read-only chat
318
+ and will not see who the other members are.
319
+
320
+ Called `broadcast` here rather than `channel`,
321
+ because the word "channel" already appears a lot in the code,
322
+ which would make it hard to grep for it.
323
+
324
+ After creation, the chat contains no recipients and is in _unpromoted_ state;
325
+ see `create_group()` for more information on the unpromoted state.
326
+
327
+ Returns the created chat.
328
+ """
329
+ return Chat(self, self._rpc.create_broadcast(self.id, name))
330
+
298
331
  def get_chat_by_id(self, chat_id: int) -> Chat:
299
332
  """Return the Chat instance with the given ID."""
300
333
  return Chat(self, chat_id)
@@ -8,8 +8,8 @@ COMMAND_PREFIX = "/"
8
8
  class ContactFlag(IntEnum):
9
9
  """Bit flags for get_contacts() method."""
10
10
 
11
- VERIFIED_ONLY = 0x01
12
11
  ADD_SELF = 0x02
12
+ ADDRESS = 0x04
13
13
 
14
14
 
15
15
  class ChatlistFlag(IntEnum):
@@ -91,10 +91,40 @@ class ChatType(IntEnum):
91
91
  """Chat type."""
92
92
 
93
93
  UNDEFINED = 0
94
+
94
95
  SINGLE = 100
96
+ """1:1 chat, i.e. a direct chat with a single contact"""
97
+
95
98
  GROUP = 120
99
+
96
100
  MAILINGLIST = 140
97
- BROADCAST = 160
101
+
102
+ OUT_BROADCAST = 160
103
+ """Outgoing broadcast channel, called "Channel" in the UI.
104
+
105
+ The user can send into this channel,
106
+ and all recipients will receive messages
107
+ in an `IN_BROADCAST`.
108
+
109
+ Called `broadcast` here rather than `channel`,
110
+ because the word "channel" already appears a lot in the code,
111
+ which would make it hard to grep for it.
112
+ """
113
+
114
+ IN_BROADCAST = 165
115
+ """Incoming broadcast channel, called "Channel" in the UI.
116
+
117
+ This channel is read-only,
118
+ and we do not know who the other recipients are.
119
+
120
+ This is similar to a `MAILINGLIST`,
121
+ with the main difference being that
122
+ `IN_BROADCAST`s are encrypted.
123
+
124
+ Called `broadcast` here rather than `channel`,
125
+ because the word "channel" already appears a lot in the code,
126
+ which would make it hard to grep for it.
127
+ """
98
128
 
99
129
 
100
130
  class ChatVisibility(str, Enum):
@@ -37,10 +37,6 @@ class Contact:
37
37
  """Delete contact."""
38
38
  self._rpc.delete_contact(self.account.id, self.id)
39
39
 
40
- def reset_encryption(self) -> None:
41
- """Reset contact encryption."""
42
- self._rpc.reset_contact_encryption(self.account.id, self.id)
43
-
44
40
  def set_name(self, name: str) -> None:
45
41
  """Change the name of this contact."""
46
42
  self._rpc.change_contact_name(self.account.id, self.id, name)
@@ -2,7 +2,7 @@
2
2
 
3
3
  import json
4
4
  from dataclasses import dataclass
5
- from typing import TYPE_CHECKING, Optional, Union
5
+ from typing import TYPE_CHECKING, List, Optional, Union
6
6
 
7
7
  from ._utils import AttrDict, futuremethod
8
8
  from .const import EventType
@@ -39,6 +39,11 @@ class Message:
39
39
  snapshot["message"] = self
40
40
  return snapshot
41
41
 
42
+ def get_read_receipts(self) -> List[AttrDict]:
43
+ """Get message read receipts."""
44
+ read_receipts = self._rpc.get_message_read_receipts(self.account.id, self.id)
45
+ return [AttrDict(read_receipt) for read_receipt in read_receipts]
46
+
42
47
  def get_reactions(self) -> Optional[AttrDict]:
43
48
  """Get message reactions."""
44
49
  reactions = self._rpc.get_message_reactions(self.account.id, self.id)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deltachat-rpc-client
3
- Version: 1.159.5
3
+ Version: 2.0.0
4
4
  Summary: Python client for Delta Chat core JSON-RPC interface
5
5
  Classifier: Development Status :: 5 - Production/Stable
6
6
  Classifier: Intended Audience :: Developers
@@ -0,0 +1,19 @@
1
+ deltachat_rpc_client/__init__.py,sha256=zroJARiq9HBi7Ln03KlICOUJHSjm3CGIFkHfXILEdOQ,567
2
+ deltachat_rpc_client/_utils.py,sha256=v0iWVSa6S-s078GgnnhflCRhA9pfWI-CfK8mjZ4zjXc,6393
3
+ deltachat_rpc_client/account.py,sha256=rgCdXo4oF7_cckBci_t03NFS0VEx-mZ5uk5rkvP9qwI,18090
4
+ deltachat_rpc_client/chat.py,sha256=LTZSYHC24bo5fDAX1XCDP79XaHIyuPZS_-zzD0vu1Rw,11238
5
+ deltachat_rpc_client/client.py,sha256=UeCJov-ZvB3WMzl_6aJEESGRQCdvS3UAKFL4Adar6cg,7206
6
+ deltachat_rpc_client/const.py,sha256=wwaXSt7gXdjveT_Hpy963WXz7AoUZ0hNS4-V9pmaX1U,6647
7
+ deltachat_rpc_client/contact.py,sha256=NLh1XNnD_LQf27pNcVgqNN97Gbv190VSCuEyjjce4L4,1893
8
+ deltachat_rpc_client/deltachat.py,sha256=4KpiHbpfXM_LmbG-OvtDACK9W09UH0tsJyFunfH9TR4,1544
9
+ deltachat_rpc_client/events.py,sha256=Y45LoGlQy0i1U-LhoqF9njqJWA8v4b-XHfXZ4VOr1TQ,10205
10
+ deltachat_rpc_client/message.py,sha256=o5XqsfwNS-MFv7ptjTA4no-OsIDliIopsMp3vs8qBwA,3946
11
+ deltachat_rpc_client/py.typed,sha256=nGQ9Itq-bkXBn5Ri1JIR0oYnDNv7LDRfkowxBSSqVTM,60
12
+ deltachat_rpc_client/pytestplugin.py,sha256=gUOP63mbEBrWJAta1JOoXaGYm3oCElYRgBkEEtKtnn8,5603
13
+ deltachat_rpc_client/rpc.py,sha256=AUY8UJP7NlRSE5ewJs9jGxJdK8etKqsCEFWiIqnX5T8,6981
14
+ deltachat_rpc_client-2.0.0.dist-info/licenses/LICENSE,sha256=Pz2eACSxkhsGfW9_iN60pgy-enjnbGTj8df8O3ebnQQ,16726
15
+ deltachat_rpc_client-2.0.0.dist-info/METADATA,sha256=zuDbTsinHJ5sBJpUtKF8mTOTnYHPmUgHU5SnqlEbavE,2173
16
+ deltachat_rpc_client-2.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ deltachat_rpc_client-2.0.0.dist-info/entry_points.txt,sha256=VHpX6EnKBaNj89qJWctApThnMa8suyaamfZEnQacXgc,81
18
+ deltachat_rpc_client-2.0.0.dist-info/top_level.txt,sha256=ePNMkY10htGrLiLydH1ITvYFM3LcTEa51HyPqJ40hDk,21
19
+ deltachat_rpc_client-2.0.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.4.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,19 +0,0 @@
1
- deltachat_rpc_client/__init__.py,sha256=zroJARiq9HBi7Ln03KlICOUJHSjm3CGIFkHfXILEdOQ,567
2
- deltachat_rpc_client/_utils.py,sha256=v0iWVSa6S-s078GgnnhflCRhA9pfWI-CfK8mjZ4zjXc,6393
3
- deltachat_rpc_client/account.py,sha256=1Vh2Dez3CCpXaZaa9Fyjpx8fkKheg5n-4_1YOZ5qqTM,16554
4
- deltachat_rpc_client/chat.py,sha256=LTZSYHC24bo5fDAX1XCDP79XaHIyuPZS_-zzD0vu1Rw,11238
5
- deltachat_rpc_client/client.py,sha256=UeCJov-ZvB3WMzl_6aJEESGRQCdvS3UAKFL4Adar6cg,7206
6
- deltachat_rpc_client/const.py,sha256=3Ds8xvY58CIntj7SfJ6BLdlu20csBTlUV8x8OkqGXCM,5778
7
- deltachat_rpc_client/contact.py,sha256=ORhz1TWcCxvYQnpVACDptWEbrpjKoIJEsTWAcwo8Fqw,2043
8
- deltachat_rpc_client/deltachat.py,sha256=4KpiHbpfXM_LmbG-OvtDACK9W09UH0tsJyFunfH9TR4,1544
9
- deltachat_rpc_client/events.py,sha256=Y45LoGlQy0i1U-LhoqF9njqJWA8v4b-XHfXZ4VOr1TQ,10205
10
- deltachat_rpc_client/message.py,sha256=2MnC4OgDockrfqPherOI_ad8AFbGhHGLVoGKanb5GRU,3687
11
- deltachat_rpc_client/py.typed,sha256=nGQ9Itq-bkXBn5Ri1JIR0oYnDNv7LDRfkowxBSSqVTM,60
12
- deltachat_rpc_client/pytestplugin.py,sha256=gUOP63mbEBrWJAta1JOoXaGYm3oCElYRgBkEEtKtnn8,5603
13
- deltachat_rpc_client/rpc.py,sha256=AUY8UJP7NlRSE5ewJs9jGxJdK8etKqsCEFWiIqnX5T8,6981
14
- deltachat_rpc_client-1.159.5.dist-info/licenses/LICENSE,sha256=Pz2eACSxkhsGfW9_iN60pgy-enjnbGTj8df8O3ebnQQ,16726
15
- deltachat_rpc_client-1.159.5.dist-info/METADATA,sha256=kL0BDIsaZRscIRk2NBI-FlAjrDzdnl_McVDVafq0ryY,2175
16
- deltachat_rpc_client-1.159.5.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
17
- deltachat_rpc_client-1.159.5.dist-info/entry_points.txt,sha256=VHpX6EnKBaNj89qJWctApThnMa8suyaamfZEnQacXgc,81
18
- deltachat_rpc_client-1.159.5.dist-info/top_level.txt,sha256=ePNMkY10htGrLiLydH1ITvYFM3LcTEa51HyPqJ40hDk,21
19
- deltachat_rpc_client-1.159.5.dist-info/RECORD,,