From: Rado Smiljanic Date: Sat, 30 Aug 2008 06:10:50 +0000 (-0700) Subject: Make curses timeout the minimum of $timeout and $imap_keepalive. X-Git-Tag: mutt-1-5-19-rel~143 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2976a0cfbd05a6ca1f8c6a71c14decf293bee69;p=mutt Make curses timeout the minimum of $timeout and $imap_keepalive. Do keepalive in km_dokey instead of directly in menu. Closes #2747. --- diff --git a/ChangeLog b/ChangeLog index 2b6bfaf9..7f3a9bf3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,8 @@ -2008-08-29 16:54 -0700 Brendan Cully (e0f0a7915711) +2008-08-29 22:40 -0700 Brendan Cully (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 diff --git a/curs_main.c b/curs_main.c index 4f549995..2690c16a 100644 --- a/curs_main.c +++ b/curs_main.c @@ -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) { diff --git a/keymap.c b/keymap.c index ca23443d..18084d22 100644 --- 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 #include @@ -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 834f3a02..7195c90d 100644 --- a/menu.c +++ b/menu.c @@ -25,10 +25,6 @@ #include "mutt_menu.h" #include "mbyte.h" -#ifdef USE_IMAP -#include "imap.h" -#endif - #include #include @@ -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 0a7509cc..d65b7d7f 100644 --- a/pager.c +++ b/pager.c @@ -33,10 +33,6 @@ #include "mx.h" -#ifdef USE_IMAP -#include "imap_private.h" -#endif - #include "mutt_crypt.h" #include @@ -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);