deltachat-rpc-client 2.24.0__tar.gz → 2.26.0__tar.gz

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.
Files changed (33) hide show
  1. {deltachat_rpc_client-2.24.0/src/deltachat_rpc_client.egg-info → deltachat_rpc_client-2.26.0}/PKG-INFO +1 -1
  2. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/pyproject.toml +1 -1
  3. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client/account.py +2 -1
  4. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client/const.py +6 -8
  5. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0/src/deltachat_rpc_client.egg-info}/PKG-INFO +1 -1
  6. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/tests/test_securejoin.py +4 -4
  7. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/tests/test_something.py +22 -40
  8. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/LICENSE +0 -0
  9. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/README.md +0 -0
  10. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/setup.cfg +0 -0
  11. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client/__init__.py +0 -0
  12. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client/_utils.py +0 -0
  13. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client/chat.py +0 -0
  14. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client/client.py +0 -0
  15. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client/contact.py +0 -0
  16. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client/deltachat.py +0 -0
  17. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client/events.py +0 -0
  18. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client/message.py +0 -0
  19. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client/py.typed +0 -0
  20. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client/pytestplugin.py +0 -0
  21. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client/rpc.py +0 -0
  22. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client.egg-info/SOURCES.txt +0 -0
  23. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client.egg-info/dependency_links.txt +0 -0
  24. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client.egg-info/entry_points.txt +0 -0
  25. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/src/deltachat_rpc_client.egg-info/top_level.txt +0 -0
  26. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/tests/test_account_events.py +0 -0
  27. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/tests/test_calls.py +0 -0
  28. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/tests/test_chatlist_events.py +0 -0
  29. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/tests/test_iroh_webxdc.py +0 -0
  30. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/tests/test_key_transfer.py +0 -0
  31. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/tests/test_multidevice.py +0 -0
  32. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/tests/test_vcard.py +0 -0
  33. {deltachat_rpc_client-2.24.0 → deltachat_rpc_client-2.26.0}/tests/test_webxdc.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deltachat-rpc-client
3
- Version: 2.24.0
3
+ Version: 2.26.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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "deltachat-rpc-client"
7
- version = "2.24.0"
7
+ version = "2.26.0"
8
8
  description = "Python client for Delta Chat core JSON-RPC interface"
9
9
  classifiers = [
10
10
  "Development Status :: 5 - Production/Stable",
@@ -399,9 +399,10 @@ class Account:
399
399
  next_msg_ids = self._rpc.get_next_msgs(self.id)
400
400
  return [Message(self, msg_id) for msg_id in next_msg_ids]
401
401
 
402
+ @futuremethod
402
403
  def wait_next_messages(self) -> list[Message]:
403
404
  """Wait for new messages and return a list of them."""
404
- next_msg_ids = self._rpc.wait_next_msgs(self.id)
405
+ next_msg_ids = yield self._rpc.wait_next_msgs.future(self.id)
405
406
  return [Message(self, msg_id) for msg_id in next_msg_ids]
406
407
 
407
408
  def wait_for_incoming_msg_event(self):
@@ -91,19 +91,17 @@ class ChatId(IntEnum):
91
91
  LAST_SPECIAL = 9
92
92
 
93
93
 
94
- class ChatType(IntEnum):
94
+ class ChatType(str, Enum):
95
95
  """Chat type."""
96
96
 
97
- UNDEFINED = 0
98
-
99
- SINGLE = 100
97
+ SINGLE = "Single"
100
98
  """1:1 chat, i.e. a direct chat with a single contact"""
101
99
 
102
- GROUP = 120
100
+ GROUP = "Group"
103
101
 
104
- MAILINGLIST = 140
102
+ MAILINGLIST = "Mailinglist"
105
103
 
106
- OUT_BROADCAST = 160
104
+ OUT_BROADCAST = "OutBroadcast"
107
105
  """Outgoing broadcast channel, called "Channel" in the UI.
108
106
 
109
107
  The user can send into this channel,
@@ -115,7 +113,7 @@ class ChatType(IntEnum):
115
113
  which would make it hard to grep for it.
116
114
  """
117
115
 
118
- IN_BROADCAST = 165
116
+ IN_BROADCAST = "InBroadcast"
119
117
  """Incoming broadcast channel, called "Channel" in the UI.
120
118
 
121
119
  This channel is read-only,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deltachat-rpc-client
3
- Version: 2.24.0
3
+ Version: 2.26.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
@@ -122,7 +122,7 @@ def test_qr_securejoin_broadcast(acfactory, all_devices_online):
122
122
  bob2.start_io()
123
123
 
124
124
  logging.info("===================== Alice creates a broadcast =====================")
125
- alice_chat = alice.create_broadcast("Broadcast channel for everyone!")
125
+ alice_chat = alice.create_broadcast("Broadcast channel!")
126
126
  snapshot = alice_chat.get_basic_snapshot()
127
127
  assert not snapshot.is_unpromoted # Broadcast channels are never unpromoted
128
128
 
@@ -135,8 +135,8 @@ def test_qr_securejoin_broadcast(acfactory, all_devices_online):
135
135
  alice_chat.send_text("Hello everyone!")
136
136
 
137
137
  def get_broadcast(ac):
138
- chat = ac.get_chatlist(query="Broadcast channel for everyone!")[0]
139
- assert chat.get_basic_snapshot().name == "Broadcast channel for everyone!"
138
+ chat = ac.get_chatlist(query="Broadcast channel!")[0]
139
+ assert chat.get_basic_snapshot().name == "Broadcast channel!"
140
140
  return chat
141
141
 
142
142
  def wait_for_broadcast_messages(ac):
@@ -184,7 +184,7 @@ def test_qr_securejoin_broadcast(acfactory, all_devices_online):
184
184
 
185
185
  chat_snapshot = chat.get_full_snapshot()
186
186
  assert chat_snapshot.is_encrypted
187
- assert chat_snapshot.name == "Broadcast channel for everyone!"
187
+ assert chat_snapshot.name == "Broadcast channel!"
188
188
  if inviter_side:
189
189
  assert chat_snapshot.chat_type == ChatType.OUT_BROADCAST
190
190
  else:
@@ -338,44 +338,27 @@ def test_receive_imf_failure(acfactory) -> None:
338
338
 
339
339
  bob.set_config("fail_on_receiving_full_msg", "1")
340
340
  alice_chat_bob.send_text("Hello!")
341
- event = bob.wait_for_incoming_msg_event()
342
- chat_id = event.chat_id
341
+ event = bob.wait_for_event(EventType.MSGS_CHANGED)
342
+ assert event.chat_id == bob.get_device_chat().id
343
343
  msg_id = event.msg_id
344
344
  message = bob.get_message_by_id(msg_id)
345
345
  snapshot = message.get_snapshot()
346
- assert snapshot.chat_id == chat_id
347
- assert snapshot.download_state == DownloadState.AVAILABLE
348
- assert snapshot.error is not None
349
- assert snapshot.show_padlock
350
- snapshot.chat.accept()
346
+ assert (
347
+ snapshot.text == "❌ Failed to receive a message:"
348
+ " Condition failed: `!context.get_config_bool(Config::FailOnReceivingFullMsg).await?`."
349
+ " Please report this bug to delta@merlinux.eu or https://support.delta.chat/."
350
+ )
351
351
 
352
352
  # The failed message doesn't break the IMAP loop.
353
353
  bob.set_config("fail_on_receiving_full_msg", "0")
354
354
  alice_chat_bob.send_text("Hello again!")
355
355
  event = bob.wait_for_incoming_msg_event()
356
- assert event.chat_id == chat_id
357
- msg_id = event.msg_id
358
- message1 = bob.get_message_by_id(msg_id)
359
- snapshot = message1.get_snapshot()
360
- assert snapshot.chat_id == chat_id
361
- assert snapshot.download_state == DownloadState.DONE
362
- assert snapshot.error is None
363
-
364
- # The failed message can be re-downloaded later.
365
- bob._rpc.download_full_message(bob.id, message.id)
366
- event = bob.wait_for_event(EventType.MSGS_CHANGED)
367
- message = bob.get_message_by_id(event.msg_id)
368
- snapshot = message.get_snapshot()
369
- assert snapshot.download_state == DownloadState.IN_PROGRESS
370
- event = bob.wait_for_event(EventType.MSGS_CHANGED)
371
- assert event.chat_id == chat_id
372
356
  msg_id = event.msg_id
373
357
  message = bob.get_message_by_id(msg_id)
374
358
  snapshot = message.get_snapshot()
375
- assert snapshot.chat_id == chat_id
359
+ assert snapshot.text == "Hello again!"
376
360
  assert snapshot.download_state == DownloadState.DONE
377
361
  assert snapshot.error is None
378
- assert snapshot.text == "Hello!"
379
362
 
380
363
 
381
364
  def test_selfavatar_sync(acfactory, data, log) -> None:
@@ -501,22 +484,21 @@ def test_wait_next_messages(acfactory) -> None:
501
484
  # There are no old messages and the call returns immediately.
502
485
  assert not bot.wait_next_messages()
503
486
 
504
- with concurrent.futures.ThreadPoolExecutor(max_workers=1) as executor:
505
- # Bot starts waiting for messages.
506
- next_messages_task = executor.submit(bot.wait_next_messages)
487
+ # Bot starts waiting for messages.
488
+ next_messages_task = bot.wait_next_messages.future()
507
489
 
508
- alice_contact_bot = alice.create_contact(bot, "Bot")
509
- alice_chat_bot = alice_contact_bot.create_chat()
510
- alice_chat_bot.send_text("Hello!")
490
+ alice_contact_bot = alice.create_contact(bot, "Bot")
491
+ alice_chat_bot = alice_contact_bot.create_chat()
492
+ alice_chat_bot.send_text("Hello!")
511
493
 
512
- next_messages = next_messages_task.result()
494
+ next_messages = next_messages_task()
513
495
 
514
- if len(next_messages) == E2EE_INFO_MSGS:
515
- next_messages += bot.wait_next_messages()
496
+ if len(next_messages) == E2EE_INFO_MSGS:
497
+ next_messages += bot.wait_next_messages()
516
498
 
517
- assert len(next_messages) == 1 + E2EE_INFO_MSGS
518
- snapshot = next_messages[0 + E2EE_INFO_MSGS].get_snapshot()
519
- assert snapshot.text == "Hello!"
499
+ assert len(next_messages) == 1 + E2EE_INFO_MSGS
500
+ snapshot = next_messages[0 + E2EE_INFO_MSGS].get_snapshot()
501
+ assert snapshot.text == "Hello!"
520
502
 
521
503
 
522
504
  def test_import_export_backup(acfactory, tmp_path) -> None:
@@ -940,7 +922,7 @@ def test_leave_broadcast(acfactory, all_devices_online):
940
922
  bob2.start_io()
941
923
 
942
924
  logging.info("===================== Alice creates a broadcast =====================")
943
- alice_chat = alice.create_broadcast("Broadcast channel for everyone!")
925
+ alice_chat = alice.create_broadcast("Broadcast channel!")
944
926
 
945
927
  logging.info("===================== Bob joins the broadcast =====================")
946
928
  qr_code = alice_chat.get_qr_code()
@@ -957,8 +939,8 @@ def test_leave_broadcast(acfactory, all_devices_online):
957
939
  assert member_added_msg.get_snapshot().text == "You joined the channel."
958
940
 
959
941
  def get_broadcast(ac):
960
- chat = ac.get_chatlist(query="Broadcast channel for everyone!")[0]
961
- assert chat.get_basic_snapshot().name == "Broadcast channel for everyone!"
942
+ chat = ac.get_chatlist(query="Broadcast channel!")[0]
943
+ assert chat.get_basic_snapshot().name == "Broadcast channel!"
962
944
  return chat
963
945
 
964
946
  def check_account(ac, contact, inviter_side, please_wait_info_msg=False):