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:
parent
17a29def4b
commit
41aa51e7ab
@ -75,6 +75,7 @@ struct local_mail_s {
|
|||||||
int trashed_mail_count;
|
int trashed_mail_count;
|
||||||
float interval;
|
float interval;
|
||||||
time_t last_mtime;
|
time_t last_mtime;
|
||||||
|
time_t last_ctime; /* needed for mutt at least */
|
||||||
double last_update;
|
double last_update;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -333,7 +334,7 @@ static void update_mail_count(struct local_mail_s *mail)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
/* mbox format */
|
/* 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! */
|
/* yippee, modification time has changed, let's read mail count! */
|
||||||
static int rep;
|
static int rep;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
@ -438,6 +439,7 @@ static void update_mail_count(struct local_mail_s *mail)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mail->last_mtime = st.st_mtime;
|
mail->last_mtime = st.st_mtime;
|
||||||
|
mail->last_ctime = st.st_ctime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user