From 41aa51e7ab907940dd75b8e89b7c6d8640afee4a Mon Sep 17 00:00:00 2001 From: afa- Date: Thu, 8 Sep 2016 15:25:28 +0000 Subject: [PATCH] Check st_ctime to work with mutt MUA (#309) Check st_ctime (time of last status change) to properly update the mail count when mutt MUA is used. --- src/mail.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mail.cc b/src/mail.cc index d3a6a7da..755b50ad 100644 --- a/src/mail.cc +++ b/src/mail.cc @@ -75,6 +75,7 @@ struct local_mail_s { int trashed_mail_count; float interval; time_t last_mtime; + time_t last_ctime; /* needed for mutt at least */ double last_update; }; @@ -333,7 +334,7 @@ static void update_mail_count(struct local_mail_s *mail) } #endif /* mbox format */ - if (st.st_mtime != mail->last_mtime) { + if (st.st_mtime != mail->last_mtime || st.st_ctime != mail->last_ctime) { /* yippee, modification time has changed, let's read mail count! */ static int rep; FILE *fp; @@ -438,6 +439,7 @@ static void update_mail_count(struct local_mail_s *mail) } mail->last_mtime = st.st_mtime; + mail->last_ctime = st.st_ctime; } }