]> granicus.if.org Git - mutt/commitdiff
Make curses timeout the minimum of $timeout and $imap_keepalive.
authorRado Smiljanic <regrado@web.de>
Sat, 30 Aug 2008 06:10:50 +0000 (23:10 -0700)
committerRado Smiljanic <regrado@web.de>
Sat, 30 Aug 2008 06:10:50 +0000 (23:10 -0700)
Do keepalive in km_dokey instead of directly in menu. Closes #2747.

ChangeLog
curs_main.c
keymap.c
menu.c
pager.c

index 2b6bfaf9929150c07afaf805c0c48556074e47a8..7f3a9bf3337985f1a43fd788d1830db9af061f89 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
-2008-08-29 16:54 -0700  Brendan Cully  <brendan@kublai.com>  (e0f0a7915711)
+2008-08-29 22:40 -0700  Brendan Cully  <brendan@kublai.com>  (e37ae3f79ec0)
+
+       * imap/imap_private.h: Dead code
+
+       * imap/imap.c: Remove redundant code
 
        * imap/command.c, imap/imap.c, imap/imap_private.h, imap/message.c:
        Use sorted headers in imap_exec_msgset. Fixes [e68f79fef249]. Closes
index 4f549995e942664bc23bf352a8808f657edca054..2690c16a28a75fbffd89464e420fff527d7e0ce9 100644 (file)
@@ -518,11 +518,6 @@ int mutt_index_menu (void)
       }
     }
 
-#ifdef USE_IMAP
-    imap_keepalive ();
-    imap_disallow_reopen (Context);
-#endif
-
     if (!attach_msg)
     {
      /* check for new mail in the incoming folders */
@@ -694,6 +689,10 @@ int mutt_index_menu (void)
       mutt_curs_set (1);       /* fallback from the pager */
     }
 
+#ifdef USE_IMAP
+    imap_disallow_reopen (Context);
+#endif
+
     switch (op)
     {
 
index ca23443d41690b31e151714239342a2874396818..18084d226ffd08fff616e00bd5d47b40026a231c 100644 (file)
--- a/keymap.c
+++ b/keymap.c
@@ -26,6 +26,9 @@
 #include "keymap.h"
 #include "mapping.h"
 #include "mutt_crypt.h"
+#ifdef USE_IMAP
+#include "imap/imap.h"
+#endif
 
 #include <stdlib.h>
 #include <string.h>
@@ -386,7 +389,15 @@ int km_dokey (int menu)
   {
     /* ncurses doesn't return on resized screen when timeout is set to zero */
     if (menu != MENU_EDITOR)
-      timeout ((Timeout > 0 ? Timeout : 60) * 1000);
+    {
+      i = Timeout > 0 ? Timeout : 60;
+#ifdef USE_IMAP
+      imap_keepalive ();
+      if (ImapKeepalive && ImapKeepalive < i)
+        i = ImapKeepalive;
+#endif
+      timeout (i * 1000);
+    }
 
     tmp = mutt_getch();
 
diff --git a/menu.c b/menu.c
index 834f3a02cfcab9b67465ee79f6facb2a3d3bed1e..7195c90db184050d4f53ed30771c0171535f5aef 100644 (file)
--- a/menu.c
+++ b/menu.c
 #include "mutt_menu.h"
 #include "mbyte.h"
 
-#ifdef USE_IMAP
-#include "imap.h"
-#endif
-
 #include <string.h>
 #include <stdlib.h>
 
@@ -861,10 +857,6 @@ int mutt_menuLoop (MUTTMENU *menu)
     
     mutt_curs_set (0);
 
-#ifdef USE_IMAP
-    imap_keepalive ();
-#endif
-
     if (menu_redraw (menu) == OP_REDRAW)
       return OP_REDRAW;
     
diff --git a/pager.c b/pager.c
index 0a7509cc01708d460a93bf2e83a45909c5ee9a2c..d65b7d7f842721e732cb4bde308ce128513e66fb 100644 (file)
--- a/pager.c
+++ b/pager.c
 
 #include "mx.h"
 
-#ifdef USE_IMAP
-#include "imap_private.h"
-#endif
-
 #include "mutt_crypt.h"
 
 #include <sys/stat.h>
@@ -1590,10 +1586,6 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
   {
     mutt_curs_set (0);
 
-#ifdef USE_IMAP
-    imap_keepalive ();
-#endif
-    
     if (redraw & REDRAW_FULL)
     {
       SETCOLOR (MT_COLOR_NORMAL);