From 8341a4e8ec6200811df52fdaa338c76bbace202f Mon Sep 17 00:00:00 2001 From: Jieiku <106644+Jieiku@users.noreply.github.com> Date: Sun, 30 Jul 2023 11:13:32 -0700 Subject: [PATCH] Config option to save drafts silently --- config/defaults.inc.php | 3 +++ program/actions/mail/send.php | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config/defaults.inc.php b/config/defaults.inc.php index 31c89a36fc..23f8327b4a 100644 --- a/config/defaults.inc.php +++ b/config/defaults.inc.php @@ -1344,6 +1344,9 @@ // save compose message every 300 seconds (5min) $config['draft_autosave'] = 300; +// save compose message silently +$config['draft_autosave_silent'] = false; + // Interface layout. Default: 'widescreen'. // 'widescreen' - three columns // 'desktop' - two columns, preview on bottom diff --git a/program/actions/mail/send.php b/program/actions/mail/send.php index e265c3bb90..b66c779315 100644 --- a/program/actions/mail/send.php +++ b/program/actions/mail/send.php @@ -272,8 +272,10 @@ public function run($args = []) 'folder' => $store_target ]); - // display success - $rcmail->output->show_message(!empty($plugin['message']) ? $plugin['message'] : 'messagesaved', 'confirmation'); + if ($rcmail->config->get('draft_autosave_silent') != true) { + // display success + $rcmail->output->show_message(!empty($plugin['message']) ? $plugin['message'] : 'messagesaved', 'confirmation'); + } // update "_draft_saveid" and the "cmp_hash" to prevent "Unsaved changes" warning $COMPOSE['param']['draft_uid'] = $plugin['uid'];