1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-27 20:44:56 +00:00

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.
This commit is contained in:
afa- 2016-09-08 15:25:28 +00:00 committed by Brenden Matthews
parent 17a29def4b
commit 41aa51e7ab

View File

@ -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;
}
}