smtp: cancel message sending by removing the message

This restores the logic removed in
afd8c0d879
This commit is contained in:
link2xt
2022-01-30 10:52:03 +00:00
parent 99f2680e2c
commit e858a32aa1
2 changed files with 15 additions and 0 deletions

View File

@@ -7,6 +7,8 @@
- use webxdc app name in chatlist/quotes/replies etc. #3027
- refactorings #3023
- remove direct dependency on `byteorder` crate #3031
- make it possible to cancel message sending by removing the message #3034,
this was previosuly removed in 1.71.0 #2939
### Fixes
- fix splitting off text from webxdc messages #3032

View File

@@ -369,6 +369,19 @@ pub(crate) async fn send_msg_to_smtp(
)
.collect::<Vec<_>>();
// If there is a msg-id and it does not exist in the db, cancel sending. this happens if
// dc_delete_msgs() was called before the generated mime was sent out.
if !message::exists(context, msg_id)
.await
.with_context(|| format!("failed to check message {} existence", msg_id))?
{
info!(
context,
"Sending of message {} was cancelled by the user.", msg_id
);
return Ok(());
}
let status = match smtp_send(
context,
&recipients_list,