From: Martin Mares Date: Fri, 20 May 2005 21:21:21 +0000 (+0000) Subject: ... X-Git-Tag: v1.4~45 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=e4d98a565f8d3d47bac039a8f6b43bdb222b3215;p=checkmail.git ... --- diff --git a/cm.c b/cm.c index 6a421e0..09dce99 100644 --- a/cm.c +++ b/cm.c @@ -278,6 +278,7 @@ static void scan(void) { debug("Searching for mailboxes...\n"); + last_scan_time = time(NULL); 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]); - printw("%4d ", b->total); + printw("%6d ", b->total); 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]);