diff --git a/CHANGELOG.md b/CHANGELOG.md index c6170c32c..9ad5e3b42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/smtp.rs b/src/smtp.rs index 6a6734764..e8f19cc38 100644 --- a/src/smtp.rs +++ b/src/smtp.rs @@ -369,6 +369,19 @@ pub(crate) async fn send_msg_to_smtp( ) .collect::>(); + // 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,