fix redundant copy saved

This commit is contained in:
Clément DOUIN
2023-12-20 16:43:33 +01:00
parent 92a94c8ff1
commit 2351cfdd28
4 changed files with 7 additions and 12 deletions
+2
View File
@@ -70,6 +70,8 @@ impl MessageReplyCommand {
.build()
.await?;
editor::edit_tpl_with_editor(&account_config, printer, &backend, tpl).await?;
// TODO: let backend.send_reply_raw_message adding the flag
backend.add_flag(&folder, &[id], Flag::Answered).await
}
}
+2 -9
View File
@@ -3,7 +3,7 @@ use email::{
account::config::AccountConfig,
email::utils::{local_draft_path, remove_local_draft},
flag::{Flag, Flags},
folder::{DRAFTS, SENT},
folder::DRAFTS,
};
use log::debug;
use mml::MmlCompilerBuilder;
@@ -45,7 +45,7 @@ pub async fn open_with_local_draft() -> Result<String> {
}
pub async fn edit_tpl_with_editor<P: Printer>(
config: &AccountConfig,
#[allow(unused)] config: &AccountConfig,
printer: &mut P,
backend: &Backend,
mut tpl: String,
@@ -90,13 +90,6 @@ pub async fn edit_tpl_with_editor<P: Printer>(
backend.send_raw_message(&email).await?;
if config.should_save_copy_sent_message() {
printer.print_log("Adding email to the Sent folder…")?;
backend
.add_raw_message_with_flag(SENT, &email, Flag::Seen)
.await?;
}
remove_local_draft()?;
printer.print("Done!")?;
break;