]> mj.ucw.cz Git - checkmail.git/commitdiff
...
authorMartin Mares <mj@ucw.cz>
Fri, 20 May 2005 21:21:21 +0000 (21:21 +0000)
committerMartin Mares <mj@ucw.cz>
Fri, 20 May 2005 21:21:21 +0000 (21:21 +0000)
cm.c

diff --git a/cm.c b/cm.c
index 6a421e042f2f66b8e82255bf1e13ecdddf2359e4..09dce992e942ea22dbc6bf48e1ef663ac5b833dd 100644 (file)
--- a/cm.c
+++ b/cm.c
@@ -278,6 +278,7 @@ static void
 scan(void)
 {
   debug("Searching for mailboxes...\n");
 scan(void)
 {
   debug("Searching for mailboxes...\n");
+  last_scan_time = time(NULL);
   int changed = 0;
   CLIST_FOR_EACH(struct mbox *, p, patterns)
     {
   int changed = 0;
   CLIST_FOR_EACH(struct mbox *, p, patterns)
     {
@@ -416,11 +417,19 @@ redraw_line(int i)
       else
        {
          attrset(attrs[cc][hi][M_IDLE]);
       else
        {
          attrset(attrs[cc][hi][M_IDLE]);
-         printw("%4d ", b->total);
+         printw("%6d ", b->total);
          if (b->new)
            {
              attrset(attrs[cc][hi][M_NEW]);
          if (b->new)
            {
              attrset(attrs[cc][hi][M_NEW]);
-             printw("%4d", b->new);
+             printw("%6d  ", b->new);
+             attrset(attrs[cc][hi][M_IDLE]);
+             int age = (last_scan_time - b->last_time);
+             if (age < 0)
+               age = 0;
+             if (age < 3600)
+               printw("%2d min", age/60);
+             else if (age < 86400)
+               printw("%2d hrs", age/3600);
            }
        }
       attrset(attrs[cc][hi][M_IDLE]);
            }
        }
       attrset(attrs[cc][hi][M_IDLE]);