mirror of
https://github.com/deltachat/deltachat-core.git
synced 2025-10-04 02:09:17 +02:00
add forward messages API
This commit is contained in:
parent
e777b576cb
commit
cfb05bdf82
2 changed files with 41 additions and 2 deletions
|
@ -122,6 +122,35 @@ class TestOnlineAccount:
|
|||
assert ac1.get_config("mail_pw")
|
||||
assert ac1.is_configured()
|
||||
|
||||
def test_forward_messages(self, acfactory):
|
||||
ac1 = acfactory.get_live_account()
|
||||
ac2 = acfactory.get_live_account()
|
||||
c2 = ac1.create_contact(email=ac2.get_config("addr"))
|
||||
chat = ac1.create_chat_by_contact(c2)
|
||||
assert chat.id >= lib.DC_CHAT_ID_LAST_SPECIAL
|
||||
|
||||
self.wait_successful_IMAP_SMTP_connection(ac1)
|
||||
self.wait_successful_IMAP_SMTP_connection(ac2)
|
||||
self.wait_configuration_progress(ac1, 1000)
|
||||
self.wait_configuration_progress(ac2, 1000)
|
||||
msg_out = chat.send_text_message("message2")
|
||||
|
||||
# wait for other account to receive
|
||||
ev = ac2._evlogger.get_matching("DC_EVENT_MSGS_CHANGED")
|
||||
assert ev[2] == msg_out.id
|
||||
msg_in = ac2.get_message_by_id(msg_out.id)
|
||||
assert msg_in.text == "message2"
|
||||
|
||||
# check the message arrived in contact-requests/deaddrop
|
||||
chat2 = msg_in.chat
|
||||
assert msg_in in chat2.get_messages()
|
||||
assert chat2.is_deaddrop()
|
||||
chat3 = ac2.create_group_chat("newgroup")
|
||||
assert not chat3.is_promoted()
|
||||
ac2.forward_messages([msg_in], chat3)
|
||||
assert chat3.is_promoted()
|
||||
assert chat3.get_messages()
|
||||
|
||||
def test_send_and_receive_message(self, acfactory):
|
||||
ac1 = acfactory.get_live_account()
|
||||
ac2 = acfactory.get_live_account()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue