[PATCH 5/6] Let the user configure how long to IDLE for

Ethan Glasser-Camp ethan at betacantrips.com
Wed May 18 13:48:56 BST 2011


This commit was originally by James Bunton <jamesbunton at fastmail.fm>.

Signed-off-by: Ethan Glasser-Camp <ethan at betacantrips.com>
---
 offlineimap/repository/IMAP.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py
index 1d40a8f..3517d88 100644
--- a/offlineimap/repository/IMAP.py
+++ b/offlineimap/repository/IMAP.py
@@ -84,9 +84,11 @@ class IMAPRepository(BaseRepository):
         return self.getconfboolean("holdconnectionopen", 0)
 
     def getkeepalive(self):
-        if self.getidlefolders():
+        num = self.getconfint("keepalive", 0)
+        if num == 0 and self.getidlefolders():
             return 29*60
-        return self.getconfint("keepalive", 0)
+        else:
+            return num
 
     def getsep(self):
         return self.imapserver.delim
-- 
1.7.4.1





More information about the OfflineIMAP-project mailing list