Skip to content

Commit 9677604

Browse files
committed
fix: stop notifying about messages in contact request chats
1 parent 2ada3cd commit 9677604

File tree

8 files changed

+127
-46
lines changed

8 files changed

+127
-46
lines changed

deltachat-rpc-client/tests/test_calls.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def test_no_contact_request_call(acfactory) -> None:
103103
# There should be no incoming call notification.
104104
assert event.kind != EventType.INCOMING_CALL
105105

106-
if event.kind == EventType.INCOMING_MSG:
106+
if event.kind == EventType.MSGS_CHANGED:
107107
msg = bob.get_message_by_id(event.msg_id)
108-
assert msg.get_snapshot().text == "Hello!"
109-
break
108+
if msg.get_snapshot().text == "Hello!":
109+
break

deltachat-rpc-client/tests/test_chatlist_events.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,13 @@ def test_imap_sync_seen_msgs(acfactory: ACFactory) -> None:
169169
"""
170170
alice, alice_second_device, bob, alice_chat_bob = get_multi_account_test_setup(acfactory)
171171

172+
bob.create_chat(alice)
173+
172174
alice_chat_bob.send_text("hello")
173175

174176
msg = bob.wait_for_incoming_msg()
175177
bob_chat_id = msg.get_snapshot().chat_id
176178
msg.get_snapshot().chat.accept()
177-
178179
alice.clear_all_events()
179180
alice_second_device.clear_all_events()
180181
bob.get_chat_by_id(bob_chat_id).send_text("hello")

deltachat-rpc-client/tests/test_iroh_webxdc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ def test_advertisement_after_chatting(acfactory, path_to_webxdc):
214214
ac1_ac2_chat = ac1.create_chat(ac2)
215215
ac1_webxdc_msg = ac1_ac2_chat.send_message(text="WebXDC", file=path_to_webxdc)
216216
ac2_webxdc_msg = ac2.wait_for_incoming_msg()
217-
assert ac2_webxdc_msg.get_snapshot().text == "WebXDC"
217+
ac2_webxdc_msg_snapshot = ac2_webxdc_msg.get_snapshot()
218+
assert ac2_webxdc_msg_snapshot.text == "WebXDC"
219+
ac2_webxdc_msg_snapshot.chat.accept()
218220

219221
ac1_ac2_chat.send_text("Hello!")
220222
ac2_hello_msg = ac2.wait_for_incoming_msg()

deltachat-rpc-client/tests/test_something.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ def test_receive_imf_failure(acfactory) -> None:
347347
assert snapshot.download_state == DownloadState.AVAILABLE
348348
assert snapshot.error is not None
349349
assert snapshot.show_padlock
350+
snapshot.chat.accept()
350351

351352
# The failed message doesn't break the IMAP loop.
352353
bob.set_config("fail_on_receiving_full_msg", "0")
@@ -888,10 +889,12 @@ def test_rename_group(acfactory):
888889
bob_msg = bob.wait_for_incoming_msg()
889890
bob_chat = bob_msg.get_snapshot().chat
890891
assert bob_chat.get_basic_snapshot().name == "Test group"
892+
bob.wait_for_event(EventType.CHATLIST_ITEM_CHANGED)
891893

892894
for name in ["Baz", "Foo bar", "Xyzzy"]:
893895
alice_group.set_name(name)
894-
bob.wait_for_incoming_msg_event()
896+
bob.wait_for_event(EventType.CHATLIST_ITEM_CHANGED)
897+
bob.wait_for_event(EventType.CHATLIST_ITEM_CHANGED)
895898
assert bob_chat.get_basic_snapshot().name == name
896899

897900

deltachat-rpc-client/tests/test_vcard.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
def test_vcard(acfactory) -> None:
22
alice, bob, fiona = acfactory.get_online_accounts(3)
33

4+
bob.create_chat(alice)
45
alice_contact_bob = alice.create_contact(bob, "Bob")
56
alice_contact_charlie = alice.create_contact("[email protected]", "Charlie")
67
alice_contact_charlie_snapshot = alice_contact_charlie.get_snapshot()

python/tests/test_1_online.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def test_forward_own_message(acfactory, lp):
460460

461461
def test_resend_message(acfactory, lp):
462462
ac1, ac2 = acfactory.get_online_accounts(2)
463-
chat1 = ac1.create_chat(ac2)
463+
chat1 = acfactory.get_accepted_chat(ac1, ac2)
464464

465465
lp.sec("ac1: send message to ac2")
466466
chat1.send_text("message")

0 commit comments

Comments
 (0)