int scanning;
int seen;
time_t last_time;
+ time_t display_valid_until;
int last_size, last_pos;
int total, new, flagged;
int last_total, last_new, last_flagged;
if (subject[0])
add_subject_snippet(&pos, term, subject);
else
- add_snippet(&pos, term, "No subject");
+ add_snippet_raw(&pos, term, "No subject");
}
static void
if (b->sender_snippet[0])
{
add_snippet(&buf, term, b->sender_snippet);
- add_snippet(&buf, term, ": ");
+ add_snippet_raw(&buf, term, ": ");
}
add_snippet(&buf, term, b->subject_snippet);
}
redraw_line(b->index);
refresh();
}
+ else if (b->display_valid_until <= last_scan_time)
+ {
+ debug("not changed, but needs redraw\n");
+ redraw_line(b->index);
+ }
else
debug("not changed\n");
b->force_refresh = 0;
static unsigned osd_care;
#define OSD_MSG_SIZE 1024
static char osd_last_msg[OSD_MSG_SIZE];
+static time_t osd_last_time;
static void
x11_init(void)
if (b->o.osd > 0)
{
p.total_new += b->new;
- if (b->new && (!p.mbox || p.mbox->o.priority < b->o.priority))
+ if (b->new && b->last_time > osd_last_time && (!p.mbox || p.mbox->o.priority < b->o.priority))
p.mbox = b;
}
}
else
debug("OSD: No changes\n");
+ osd_last_time = time(NULL);
}
}
int hi = b->o.highlight;
unsigned namepos = 0;
unsigned namelen = strlen(b->name);
+ int valid = 3600;
attrset(attrs[cc][hi][M_IDLE]);
if (b->o.hotkey)
if (age < 0)
age = 0;
if (age < 3600)
- printw("%2d min ", age/60);
+ {
+ printw("%2d min ", age/60);
+ valid = 60;
+ }
else if (age < 86400)
- printw("%2d hrs ", age/3600);
+ printw("%2d hr%c ", age/3600, (age >= 7200 ? 's' : ' '));
else
printw(" ");
snip = 1;
int xx, yy;
getyx(stdscr, yy, xx);
int remains = COLS-1-xx;
+ (void) yy;
char snip[256];
build_snippet(snip, snip + sizeof(snip) - 1, b);
}
}
}
+ b->display_valid_until = last_scan_time + valid;
}
attrset(attrs[0][0][M_IDLE]);
clrtoeol();