adding auto-copy-blob logic when preparing a message

This commit is contained in:
holger krekel
2019-12-05 23:29:27 +01:00
parent 7f4e68f21c
commit a0517478e3
3 changed files with 20 additions and 11 deletions

View File

@@ -453,10 +453,10 @@ class TestOnlineAccount:
def send_and_receive_message():
lp.sec("ac1: prepare and send attachment + text to ac2")
msg = Message.new_empty(ac1, "file")
msg.set_text("withfile")
msg.set_file(p)
message = chat.prepare_message(msg)
msg1 = Message.new_empty(ac1, "file")
msg1.set_text("withfile")
msg1.set_file(p)
message = chat.prepare_message(msg1)
assert message.is_out_preparing()
assert message.text == "withfile"
chat.send_prepared(message)
@@ -464,7 +464,7 @@ class TestOnlineAccount:
lp.sec("ac2: receive message")
ev = ac2._evlogger.get_matching("DC_EVENT_INCOMING_MSG|DC_EVENT_MSGS_CHANGED")
assert ev[2] > const.DC_CHAT_ID_LAST_SPECIAL
return ac2.get_message_by_id(ev[1])
return ac2.get_message_by_id(ev[2])
msg = send_and_receive_message()
assert msg.text == "withfile"