From a4b6f56e49582a101d57c302301cb48c684280e4 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Sun, 15 Jun 2014 04:29:55 -0400
Subject: [PATCH] Fix list reload after sending message in another window (#1489931) - use checkmail instead of list command

---
 CHANGELOG         |    1 +
 program/js/app.js |   11 ++++++-----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index f88d359..9e26b95 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -42,6 +42,7 @@
 - Support csv contacts import in German localization (#1489920)
 - Fix so message list and counters are updated when a message is opened in new window (#1489919)
 - Fix malformed recipient name when composing a message by clicking on mailto link (#1489942)
+- Fix list reload after sending message in another window (#1489931)
 
 RELEASE 1.0.1
 -------------
diff --git a/program/js/app.js b/program/js/app.js
index 9909a02..ea7be4e 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -4280,21 +4280,22 @@
     this.display_message(msg, type);
 
     if (this.env.extwin) {
-      var rc = this.opener();
       this.lock_form(this.gui_objects.messageform);
+
+      var rc = this.opener();
       if (rc) {
         rc.display_message(msg, type);
         // refresh the folder where sent message was saved or replied message comes from
         if (folders && rc.env.task == 'mail' && rc.env.action == '' && $.inArray(rc.env.mailbox, folders) >= 0) {
-          // @TODO: try with 'checkmail' here when #1485186 is fixed. See also #1489249.
-          rc.command('list');
+          rc.command('checkmail');
         }
       }
-      setTimeout(function(){ window.close() }, 1000);
+
+      setTimeout(function() { window.close(); }, 1000);
     }
     else {
       // before redirect we need to wait some time for Chrome (#1486177)
-      setTimeout(function(){ ref.list_mailbox(); }, 500);
+      setTimeout(function() { ref.list_mailbox(); }, 500);
     }
   };
 

--
Gitblit v1.9.1