mirror of
https://github.com/chatmail/core.git
synced 2026-04-06 15:42:10 +03:00
refine test / chat API
This commit is contained in:
@@ -127,6 +127,12 @@ class FFIEventTracker:
|
||||
if ev.data2 > 0:
|
||||
return self.account.get_message_by_id(ev.data2)
|
||||
|
||||
def wait_msg_delivered(self, msg):
|
||||
ev = self.get_matching("DC_EVENT_MSG_DELIVERED")
|
||||
assert ev.data1 == msg.chat.id
|
||||
assert ev.data2 == msg.id
|
||||
assert msg.is_out_delivered()
|
||||
|
||||
|
||||
class EventThread(threading.Thread):
|
||||
""" Event Thread for an account.
|
||||
|
||||
@@ -53,15 +53,15 @@ class Message(object):
|
||||
lib.dc_msg_unref
|
||||
))
|
||||
|
||||
def accept_sender_contact(self):
|
||||
""" ensure that the sender is an accepted contact
|
||||
and that the message has a non-deaddrop chat object.
|
||||
def create_chat(self):
|
||||
""" create a chat from a message (eg Contact-Request message).
|
||||
"""
|
||||
self.account.create_chat_by_message(self)
|
||||
chat = self.account.create_chat_by_message(self)
|
||||
self._dc_msg = ffi.gc(
|
||||
lib.dc_get_msg(self.account._dc_context, self.id),
|
||||
lib.dc_msg_unref
|
||||
)
|
||||
return chat
|
||||
|
||||
@props.with_doc
|
||||
def text(self):
|
||||
|
||||
Reference in New Issue
Block a user