]> granicus.if.org Git - mutt/commitdiff
Avoid IMAP timeouts when viewing messages. From
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 8 Feb 2000 10:01:33 +0000 (10:01 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 8 Feb 2000 10:01:33 +0000 (10:01 +0000)
Tommi.Komulainen@iki.fi.

keymap.c
pager.c

index 08886ed59ed2dfa870ef19291bd205fcb85e6a29..96ff7873281843ea788b0c653a5677112830a849 100644 (file)
--- 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 75a4eff34d2fe5354d2b38b00a5c3573ac28e7dd..25980b192da6c236c4d6df8b5f1ee9443accb57b 100644 (file)
--- 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)