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

Method get_draft

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

Get draft for a chat, if any.

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

Source from the content-addressed store, hash-verified

2514
2515 /// Get draft for a chat, if any.
2516 async fn get_draft(&self, account_id: u32, chat_id: u32) -> Result<Option<MessageObject>> {
2517 let ctx = self.get_context(account_id).await?;
2518 if let Some(draft) = ChatId::new(chat_id).get_draft(&ctx).await? {
2519 Ok(MessageObject::from_msg_id(&ctx, draft.get_id()).await?)
2520 } else {
2521 Ok(None)
2522 }
2523 }
2524
2525 // ---------------------------------------------
2526 // misc prototyping functions

Callers 1

misc_send_draftMethod · 0.45

Calls 2

get_contextMethod · 0.80
get_idMethod · 0.45

Tested by

no test coverage detected