From 9ed6d46df7c2a555feeb3444c6acb0e5eaf452e9 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 15 Feb 2015 08:43:58 -0500
Subject: [PATCH] Fix refreshing of drafts list when sending a message which was saved in meantime (#1490238)

---
 CHANGELOG                       |    2 ++
 program/steps/mail/sendmail.inc |    5 +++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index b56d93f..1b98ed2 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,8 @@
 CHANGELOG Roundcube Webmail
 ===========================
 
+- Fix refreshing of drafts list when sending a message which was saved in meantime (#1490238)
+
 RELEASE 1.1.0
 -------------
 - Make SMTP error log more verbose - include server response and error code
diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc
index 76a8188..715ee32 100644
--- a/program/steps/mail/sendmail.inc
+++ b/program/steps/mail/sendmail.inc
@@ -684,11 +684,16 @@
     $OUTPUT->command('auto_save_start');
 }
 else {
+    // Collect folders which could contain the composed message,
+    // we'll refresh the list if currently opened folder is one of them (#1490238)
     $folders = array();
 
     if (in_array($COMPOSE['mode'], array('reply', 'forward', 'draft'))) {
         $folders[] = $COMPOSE['mailbox'];
     }
+    if (!empty($COMPOSE['param']['draft_uid']) && $drafts_mbox) {
+        $folders[] = $drafts_mbox;
+    }
 
     rcmail_compose_cleanup($COMPOSE_ID);
     $OUTPUT->command('remove_compose_data', $COMPOSE_ID);

--
Gitblit v1.9.1