deltachat-rpc-client 1.159.0__tar.gz → 1.159.1__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 (32) hide show
  1. {deltachat_rpc_client-1.159.0/src/deltachat_rpc_client.egg-info → deltachat_rpc_client-1.159.1}/PKG-INFO +1 -1
  2. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/pyproject.toml +1 -1
  3. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client/_utils.py +3 -2
  4. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client/account.py +5 -0
  5. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client/const.py +1 -0
  6. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client/pytestplugin.py +1 -1
  7. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1/src/deltachat_rpc_client.egg-info}/PKG-INFO +1 -1
  8. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/tests/test_account_events.py +1 -1
  9. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/tests/test_something.py +30 -10
  10. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/LICENSE +0 -0
  11. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/README.md +0 -0
  12. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/setup.cfg +0 -0
  13. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client/__init__.py +0 -0
  14. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client/chat.py +0 -0
  15. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client/client.py +0 -0
  16. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client/contact.py +0 -0
  17. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client/deltachat.py +0 -0
  18. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client/events.py +0 -0
  19. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client/message.py +0 -0
  20. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client/py.typed +0 -0
  21. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client/rpc.py +0 -0
  22. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client.egg-info/SOURCES.txt +0 -0
  23. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client.egg-info/dependency_links.txt +0 -0
  24. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client.egg-info/entry_points.txt +0 -0
  25. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/src/deltachat_rpc_client.egg-info/top_level.txt +0 -0
  26. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/tests/test_chatlist_events.py +0 -0
  27. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/tests/test_iroh_webxdc.py +0 -0
  28. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/tests/test_key_transfer.py +0 -0
  29. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/tests/test_multidevice.py +0 -0
  30. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/tests/test_securejoin.py +0 -0
  31. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/tests/test_vcard.py +0 -0
  32. {deltachat_rpc_client-1.159.0 → deltachat_rpc_client-1.159.1}/tests/test_webxdc.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deltachat-rpc-client
3
- Version: 1.159.0
3
+ Version: 1.159.1
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 = "1.159.0"
7
+ version = "1.159.1"
8
8
  description = "Python client for Delta Chat core JSON-RPC interface"
9
9
  classifiers = [
10
10
  "Development Status :: 5 - Production/Stable",
@@ -1,4 +1,5 @@
1
1
  import argparse
2
+ import os
2
3
  import re
3
4
  import sys
4
5
  from threading import Thread
@@ -89,8 +90,8 @@ def _run_cli(
89
90
  help="accounts folder (default: current working directory)",
90
91
  nargs="?",
91
92
  )
92
- parser.add_argument("--email", action="store", help="email address")
93
- parser.add_argument("--password", action="store", help="password")
93
+ parser.add_argument("--email", action="store", help="email address", default=os.getenv("DELTACHAT_EMAIL"))
94
+ parser.add_argument("--password", action="store", help="password", default=os.getenv("DELTACHAT_PASSWORD"))
94
95
  args = parser.parse_args(argv[1:])
95
96
 
96
97
  with Rpc(accounts_dir=args.accounts_dir, **kwargs) as rpc:
@@ -110,6 +110,11 @@ class Account:
110
110
  """Configure an account."""
111
111
  yield self._rpc.configure.future(self.id)
112
112
 
113
+ @futuremethod
114
+ def add_transport(self, params):
115
+ """Add a new transport."""
116
+ yield self._rpc.add_transport.future(self.id, params)
117
+
113
118
  def bring_online(self):
114
119
  """Start I/O and wait until IMAP becomes IDLE."""
115
120
  self.start_io()
@@ -48,6 +48,7 @@ class EventType(str, Enum):
48
48
  MSG_READ = "MsgRead"
49
49
  MSG_DELETED = "MsgDeleted"
50
50
  CHAT_MODIFIED = "ChatModified"
51
+ CHAT_DELETED = "ChatDeleted"
51
52
  CHAT_EPHEMERAL_TIMER_MODIFIED = "ChatEphemeralTimerModified"
52
53
  CONTACTS_CHANGED = "ContactsChanged"
53
54
  LOCATION_CHANGED = "LocationChanged"
@@ -34,7 +34,7 @@ class ACFactory:
34
34
  addr, password = self.get_credentials()
35
35
  account = self.get_unconfigured_account()
36
36
  params = {"addr": addr, "password": password}
37
- yield account._rpc.add_transport.future(account.id, params)
37
+ yield account.add_transport.future(params)
38
38
 
39
39
  assert account.is_configured()
40
40
  return account
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deltachat-rpc-client
3
- Version: 1.159.0
3
+ Version: 1.159.1
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
@@ -17,7 +17,7 @@ def test_event_on_configuration(acfactory: ACFactory) -> None:
17
17
  account = acfactory.get_unconfigured_account()
18
18
  account.clear_all_events()
19
19
  assert not account.is_configured()
20
- future = account._rpc.add_transport.future(account.id, {"addr": addr, "password": password})
20
+ future = account.add_transport.future({"addr": addr, "password": password})
21
21
  while True:
22
22
  event = account.wait_for_event()
23
23
  if event.kind == EventType.ACCOUNTS_ITEM_CHANGED:
@@ -63,8 +63,7 @@ def test_acfactory(acfactory) -> None:
63
63
  def test_configure_starttls(acfactory) -> None:
64
64
  addr, password = acfactory.get_credentials()
65
65
  account = acfactory.get_unconfigured_account()
66
- account._rpc.add_transport(
67
- account.id,
66
+ account.add_transport(
68
67
  {
69
68
  "addr": addr,
70
69
  "password": password,
@@ -81,8 +80,7 @@ def test_configure_ip(acfactory) -> None:
81
80
  ip_address = socket.gethostbyname(addr.rsplit("@")[-1])
82
81
 
83
82
  with pytest.raises(JsonRpcError):
84
- account._rpc.add_transport(
85
- account.id,
83
+ account.add_transport(
86
84
  {
87
85
  "addr": addr,
88
86
  "password": password,
@@ -96,8 +94,7 @@ def test_configure_alternative_port(acfactory) -> None:
96
94
  """Test that configuration with alternative port 443 works."""
97
95
  addr, password = acfactory.get_credentials()
98
96
  account = acfactory.get_unconfigured_account()
99
- account._rpc.add_transport(
100
- account.id,
97
+ account.add_transport(
101
98
  {
102
99
  "addr": addr,
103
100
  "password": password,
@@ -111,8 +108,7 @@ def test_configure_alternative_port(acfactory) -> None:
111
108
  def test_list_transports(acfactory) -> None:
112
109
  addr, password = acfactory.get_credentials()
113
110
  account = acfactory.get_unconfigured_account()
114
- account._rpc.add_transport(
115
- account.id,
111
+ account.add_transport(
116
112
  {
117
113
  "addr": addr,
118
114
  "password": password,
@@ -424,7 +420,7 @@ def test_wait_next_messages(acfactory) -> None:
424
420
  addr, password = acfactory.get_credentials()
425
421
  bot = acfactory.get_unconfigured_account()
426
422
  bot.set_config("bot", "1")
427
- bot._rpc.add_transport(bot.id, {"addr": addr, "password": password})
423
+ bot.add_transport({"addr": addr, "password": password})
428
424
  assert bot.is_configured()
429
425
 
430
426
  # There are no old messages and the call returns immediately.
@@ -607,7 +603,7 @@ def test_reactions_for_a_reordering_move(acfactory, direct_imap):
607
603
 
608
604
  addr, password = acfactory.get_credentials()
609
605
  ac2 = acfactory.get_unconfigured_account()
610
- ac2._rpc.add_transport(ac2.id, {"addr": addr, "password": password})
606
+ ac2.add_transport({"addr": addr, "password": password})
611
607
  ac2.set_config("mvbox_move", "1")
612
608
  assert ac2.is_configured()
613
609
 
@@ -805,3 +801,27 @@ def test_get_all_accounts_deadlock(rpc):
805
801
  all_accounts = rpc.get_all_accounts.future()
806
802
  rpc.add_account()
807
803
  all_accounts()
804
+
805
+
806
+ def test_delete_deltachat_folder(acfactory, direct_imap):
807
+ """Test that DeltaChat folder is recreated if user deletes it manually."""
808
+ ac1 = acfactory.new_configured_account()
809
+ ac1.set_config("mvbox_move", "1")
810
+ ac1.bring_online()
811
+
812
+ ac1_direct_imap = direct_imap(ac1)
813
+ ac1_direct_imap.conn.folder.delete("DeltaChat")
814
+ assert "DeltaChat" not in ac1_direct_imap.list_folders()
815
+
816
+ # Wait until new folder is created and UIDVALIDITY is updated.
817
+ while True:
818
+ event = ac1.wait_for_event()
819
+ if event.kind == EventType.INFO and "uid/validity change folder DeltaChat" in event.msg:
820
+ break
821
+
822
+ ac2 = acfactory.get_online_account()
823
+ ac2.create_chat(ac1).send_text("hello")
824
+ msg = ac1.wait_for_incoming_msg().get_snapshot()
825
+ assert msg.text == "hello"
826
+
827
+ assert "DeltaChat" in ac1_direct_imap.list_folders()