mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 21:36:29 +03:00
api(deltachat-rpc-client): add Chat.resend_messages()
This commit is contained in:
@@ -168,6 +168,11 @@ class Chat:
|
|||||||
msg_id = self._rpc.send_sticker(self.account.id, self.id, path)
|
msg_id = self._rpc.send_sticker(self.account.id, self.id, path)
|
||||||
return Message(self.account, msg_id)
|
return Message(self.account, msg_id)
|
||||||
|
|
||||||
|
def resend_messages(self, messages: list[Message]) -> None:
|
||||||
|
"""Resend a list of messages to this chat."""
|
||||||
|
msg_ids = [msg.id for msg in messages]
|
||||||
|
self._rpc.resend_messages(self.account.id, msg_ids)
|
||||||
|
|
||||||
def forward_messages(self, messages: list[Message]) -> None:
|
def forward_messages(self, messages: list[Message]) -> None:
|
||||||
"""Forward a list of messages to this chat."""
|
"""Forward a list of messages to this chat."""
|
||||||
msg_ids = [msg.id for msg in messages]
|
msg_ids = [msg.id for msg in messages]
|
||||||
|
|||||||
@@ -252,6 +252,7 @@ def test_chat(acfactory) -> None:
|
|||||||
bob_chat_alice.get_encryption_info()
|
bob_chat_alice.get_encryption_info()
|
||||||
|
|
||||||
group = alice.create_group("test group")
|
group = alice.create_group("test group")
|
||||||
|
to_resend = group.send_text("will be resent")
|
||||||
group.add_contact(alice_contact_bob)
|
group.add_contact(alice_contact_bob)
|
||||||
group.get_qr_code()
|
group.get_qr_code()
|
||||||
|
|
||||||
@@ -263,6 +264,7 @@ def test_chat(acfactory) -> None:
|
|||||||
|
|
||||||
msg = group.send_message(text="hi")
|
msg = group.send_message(text="hi")
|
||||||
assert (msg.get_snapshot()).text == "hi"
|
assert (msg.get_snapshot()).text == "hi"
|
||||||
|
group.resend_messages([to_resend])
|
||||||
group.forward_messages([msg])
|
group.forward_messages([msg])
|
||||||
|
|
||||||
group.set_draft(text="test draft")
|
group.set_draft(text="test draft")
|
||||||
|
|||||||
Reference in New Issue
Block a user