send the chat's current set draft
(&self, account_id: u32, chat_id: u32)
| 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) |
nothing calls this directly
no test coverage detected