1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-05 10:39:27 +02:00

add forward messages API

This commit is contained in:
holger krekel 2018-09-18 20:18:18 +02:00
parent e777b576cb
commit cfb05bdf82
2 changed files with 41 additions and 2 deletions

View file

@ -136,8 +136,8 @@ class Account(object):
return Chat(self._dc_context, chat_id)
def create_chat_by_message(self, message):
""" create or get an existing 1:1 chat object for the specified sender
of the specified message.
""" create or get an existing chat object for the
the specified message.
:param message: messsage id or message instance.
:returns: a :class:`Chat` object.
@ -191,6 +191,16 @@ class Account(object):
msg_ids = ffi.cast("uint32_t*", ffi.from_buffer(arr))
lib.dc_markseen_msgs(self._dc_context, msg_ids, len(messages))
def forward_messages(self, messages, chat):
""" Forward list of messages to a chat.
:param messages: list of :class:`Message` object.
:param chat: :class:`Chat` object.
:returns: None
"""
msg_ids = [msg.id for msg in messages]
lib.dc_forward_msgs(self._dc_context, msg_ids, len(msg_ids), chat.id)
def start(self):
""" configure this account object, start receiving events,
start IMAP/SMTP threads. """