From 41b43ba00e9110e6f415014382e11af7fe381fcb Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Fri, 28 Nov 2008 14:01:35 -0500
Subject: [PATCH] Don't set client busy when automatically checking for new messages (#1485276)

---
 program/js/app.js |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index 82687da..f301e55 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -202,6 +202,8 @@
             }
           if (this.env.drafts_mailbox)
             this.enable_command('savedraft', true);
+            
+          document.onmouseup = function(e){ return p.doc_mouse_up(e); };
           }
 
         if (this.env.messagecount)
@@ -364,7 +366,7 @@
   this.start_keepalive = function()
     {
     if (this.env.keep_alive && !this.env.framed && this.task=='mail' && this.gui_objects.mailboxlist)
-      this._int = setInterval(function(){ ref.check_for_recent(); }, this.env.keep_alive * 1000);
+      this._int = setInterval(function(){ ref.check_for_recent(false); }, this.env.keep_alive * 1000);
     else if (this.env.keep_alive && !this.env.framed && this.task!='login')
       this._int = setInterval(function(){ ref.send_keep_alive(); }, this.env.keep_alive * 1000);
     }
@@ -813,7 +815,7 @@
         break;
       
       case 'checkmail':
-        this.check_for_recent();
+        this.check_for_recent(true);
         break;
       
       case 'compose':
@@ -2503,7 +2505,7 @@
         li = document.createElement('LI');
         li.innerHTML = a_results[i].replace(/</, '&lt;').replace(/>/, '&gt;').replace(new RegExp('('+this.ksearch_value+')', 'ig'), '<b>$1</b>');
         li.onmouseover = function(){ ref.ksearch_select(this); };
-        li.onclick = function(){ ref.ksearch_click(this) };
+        li.onmouseup = function(){ ref.ksearch_click(this) };
         li._rcm_id = a_result_ids[i];
         ul.appendChild(li);
       }
@@ -3914,12 +3916,14 @@
     };
 
   // send periodic request to check for recent messages
-  this.check_for_recent = function()
+  this.check_for_recent = function(setbusy)
     {
     if (this.busy)
       return;
 
-    this.set_busy(true, 'checkingmail');
+    if (setbusy)
+      this.set_busy(true, 'checkingmail');
+
     this.http_request('check-recent', (this.env.search_request ? '_search='+this.env.search_request+'&' : '') + '_t='+(new Date().getTime()), true);
     };
 

--
Gitblit v1.9.1