From 2b1e46ff3f0b6d7fa35649e4151cad685cb1fa43 Mon Sep 17 00:00:00 2001 From: Henrique Borba Date: Fri, 28 Jan 2022 10:50:15 -0300 Subject: [PATCH 1/2] Drafts must also use the user's hash to find an attachment After updating ResumableJS #524 the drafts stopped working as they were still using the old directory structure --- modules/smtp/modules.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/smtp/modules.php b/modules/smtp/modules.php index e1d568c41..a1039ab2c 100644 --- a/modules/smtp/modules.php +++ b/modules/smtp/modules.php @@ -242,8 +242,9 @@ public function process() { if ($this->module_is_supported('imap')) { $uploaded_files = explode(',', $uploaded_files); + $userpath = md5($this->session->get('username', false)); foreach($uploaded_files as $key => $file) { - $uploaded_files[$key] = $this->config->get('attachment_dir').'/'.$file; + $uploaded_files[$key] = $this->config->get('attachment_dir').DIRECTORY_SEPARATOR.$userpath.DIRECTORY_SEPARATOR.$file; } $new_draft_id = save_imap_draft(array('draft_smtp' => $smtp, 'draft_to' => $to, 'draft_body' => $body, 'draft_subject' => $subject, 'draft_cc' => $cc, 'draft_bcc' => $bcc, From 7fce245f2a58c65208f711a76af1a0c10dc1cdc6 Mon Sep 17 00:00:00 2001 From: Henrique Borba Date: Fri, 28 Jan 2022 10:58:22 -0300 Subject: [PATCH 2/2] Remove resumable progress bar when editing a draft In PR #524 we removed the progress bar after the attachment upload completed, this change was not implemented for draft editing --- modules/smtp/modules.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/smtp/modules.php b/modules/smtp/modules.php index a1039ab2c..bcdf0ca1f 100644 --- a/modules/smtp/modules.php +++ b/modules/smtp/modules.php @@ -1372,7 +1372,7 @@ function format_attachment_row($file, $output_mod) { $output_mod->html_safe($file['name']).''.$output_mod->html_safe($file['type']).' ' .$output_mod->html_safe(round($file['size']/1024, 2)). 'KB '. ''. 'Remove'. - '
'; }}