From: Martin Mares Date: Sat, 29 Mar 2014 22:34:22 +0000 (+0100) Subject: Avoid repeating the same mail in OSD announcements X-Git-Tag: v1.7~1 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=8c026dd0861854774fadd528ff51672de8ca9145;p=checkmail.git Avoid repeating the same mail in OSD announcements --- diff --git a/cm.c b/cm.c index 49d0f65..e14c8fa 100644 --- a/cm.c +++ b/cm.c @@ -637,6 +637,7 @@ static Atom osd_pty; 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) @@ -844,7 +845,7 @@ rethink_osd(int notify) 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; } @@ -862,6 +863,7 @@ rethink_osd(int notify) } else debug("OSD: No changes\n"); + osd_last_time = time(NULL); } }