From d07c743cdc0316af8cf9841b22ebdaed796ef839 Mon Sep 17 00:00:00 2001 From: Simon Laux Date: Sat, 22 Jul 2023 18:43:52 +0200 Subject: [PATCH] api(jsonrpc): add resend_messages --- deltachat-jsonrpc/src/api/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/deltachat-jsonrpc/src/api/mod.rs b/deltachat-jsonrpc/src/api/mod.rs index 617f1d6c4..d9b6db8aa 100644 --- a/deltachat-jsonrpc/src/api/mod.rs +++ b/deltachat-jsonrpc/src/api/mod.rs @@ -1709,6 +1709,20 @@ impl CommandApi { forward_msgs(&ctx, &message_ids, ChatId::new(chat_id)).await } + /// Resend messages and make information available for newly added chat members. + /// Resending sends out the original message, however, recipients and webxdc-status may differ. + /// Clients that already have the original message can still ignore the resent message as + /// they have tracked the state by dedicated updates. + /// + /// Some messages cannot be resent, eg. info-messages, drafts, already pending messages or messages that are not sent by SELF. + /// + /// message_ids all message IDs that should be resend. All messages must belong to the same chat. + async fn resend_messages(&self, account_id: u32, message_ids: Vec) -> Result<()> { + let ctx = self.get_context(account_id).await?; + let message_ids: Vec = message_ids.into_iter().map(MsgId::new).collect(); + chat::resend_msgs(&ctx, &message_ids).await + } + async fn send_sticker( &self, account_id: u32,