From: Thomas Roessler Date: Tue, 8 Feb 2000 10:01:33 +0000 (+0000) Subject: Avoid IMAP timeouts when viewing messages. From X-Git-Tag: mutt-1-1-3-rel~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2fee61e191144d489f06c989cfaf54fdb1be50a2;p=mutt Avoid IMAP timeouts when viewing messages. From Tommi.Komulainen@iki.fi. --- diff --git a/keymap.c b/keymap.c index 08886ed5..96ff7873 100644 --- a/keymap.c +++ b/keymap.c @@ -352,21 +352,12 @@ int km_dokey (int menu) FOREVER { /* ncurses doesn't return on resized screen when timeout is set to zero */ -#if !defined (USE_SLANG_CURSES) && defined (HAVE_RESIZETERM) if (menu == MENU_MAIN || menu == MENU_PAGER) - timeout (menu == MENU_MAIN && Timeout > 0 ? Timeout * 1000 : INT_MAX); -#else - if (menu == MENU_MAIN && Timeout > 0) - timeout (Timeout * 1000); /* milliseconds */ -#endif + timeout ((Timeout > 0 ? Timeout : 60) * 1000); tmp = mutt_getch(); -#if !defined (USE_SLANG_CURSES) && defined (HAVE_RESIZETERM) if (menu == MENU_MAIN || menu == MENU_PAGER) -#else - if (menu == MENU_MAIN && Timeout > 0) -#endif timeout (-1); /* restore blocking operation */ LastKey = tmp.ch; diff --git a/pager.c b/pager.c index 75a4eff3..25980b19 100644 --- a/pager.c +++ b/pager.c @@ -1431,6 +1431,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra) int indicator = indexlen / 3; /* the indicator line of the PI */ int old_PagerIndexLines; /* some people want to resize it * while inside the pager... */ + int oldcount = -1; if (!(flags & M_SHOWCOLOR)) flags |= M_SHOWFLAT; @@ -1481,10 +1482,27 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra) strcat (helpstr, buffer); } + if (Context) + oldcount = Context->msgcount; + while (ch != -1) { mutt_curs_set (0); + if (mutt_buffy_notify () && option (OPTBEEPNEW)) + beep (); + else if (Context && Context->msgcount != oldcount) + { + if (Context && Context->msgcount > oldcount) + { + mutt_message (_("New mail in this mailbox.")); + if (option (OPTBEEPNEW)) + beep (); + redraw |= REDRAW_STATUS; + } + oldcount = Context->msgcount; + } + if (redraw & REDRAW_FULL) { SETCOLOR (MT_COLOR_NORMAL); @@ -1677,7 +1695,8 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra) move (statusoffset, COLS-1); mutt_refresh (); ch = km_dokey (MENU_PAGER); - mutt_clear_error (); + if (ch != -1) + mutt_clear_error (); mutt_curs_set (1); if (SigInt)