MCPcopy Create free account
hub / github.com/chatmail/core / misc_send_draft

Method misc_send_draft

deltachat-jsonrpc/src/api.rs:2769–2780  ·  view source on GitHub ↗

send the chat's current set draft

(&self, account_id: u32, chat_id: u32)

Source from the content-addressed store, hash-verified

2767
2768 // send the chat's current set draft
2769 async fn misc_send_draft(&self, account_id: u32, chat_id: u32) -> Result<u32> {
2770 let ctx = self.get_context(account_id).await?;
2771 if let Some(draft) = ChatId::new(chat_id).get_draft(&ctx).await? {
2772 let mut draft = draft;
2773 let msg_id = chat::send_msg(&ctx, ChatId::new(chat_id), &mut draft)
2774 .await?
2775 .to_u32();
2776 Ok(msg_id)
2777 } else {
2778 Err(anyhow!("chat with id {chat_id} doesn't have draft message"))
2779 }
2780 }
2781}
2782
2783// Helper functions (to prevent code duplication)

Callers

nothing calls this directly

Calls 4

send_msgFunction · 0.85
get_contextMethod · 0.80
get_draftMethod · 0.45
to_u32Method · 0.45

Tested by

no test coverage detected