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

Method get_draft

src/chat.rs:752–763  ·  view source on GitHub ↗

Returns draft message, if there is one.

(self, context: &Context)

Source from the content-addressed store, hash-verified

750
751 /// Returns draft message, if there is one.
752 pub async fn get_draft(self, context: &Context) -> Result<Option<Message>> {
753 if self.is_special() {
754 return Ok(None);
755 }
756 match self.get_draft_msg_id(context).await? {
757 Some(draft_msg_id) => {
758 let msg = Message::load_from_db(context, draft_msg_id).await?;
759 Ok(Some(msg))
760 }
761 None => Ok(None),
762 }
763 }
764
765 /// Deletes draft message, if there is one.
766 ///

Callers 15

do_set_draftMethod · 0.45
get_infoMethod · 0.45
testMethod · 0.45
test_get_draft_no_draftFunction · 0.45
test_get_draft_no_chatFunction · 0.45
test_get_draftFunction · 0.45
test_draft_stable_idsFunction · 0.45

Calls 2

get_draft_msg_idMethod · 0.80
is_specialMethod · 0.45

Tested by 14

testMethod · 0.36
test_get_draft_no_draftFunction · 0.36
test_get_draft_no_chatFunction · 0.36
test_get_draftFunction · 0.36
test_draft_stable_idsFunction · 0.36
test_delete_webxdc_draftFunction · 0.36