diff options
author | Timo Sirainen <cras@irssi.org> | 2000-07-30 20:15:48 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-07-30 20:15:48 +0000 |
commit | 8c6bfaac6ab061404f67e3769b3e15360aa80d6a (patch) | |
tree | d43e2db709c6812850c9558f7774f614525724df /src/fe-text | |
parent | 2607b2263332644b9bfbbedd7e5a4c5f937ae644 (diff) | |
download | irssi-8c6bfaac6ab061404f67e3769b3e15360aa80d6a.zip |
Mail check: the also file size changes as well as modify time changes
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@554 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text')
-rw-r--r-- | src/fe-text/statusbar-items.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/fe-text/statusbar-items.c b/src/fe-text/statusbar-items.c index c33cf372..7ea0e6dc 100644 --- a/src/fe-text/statusbar-items.c +++ b/src/fe-text/statusbar-items.c @@ -82,7 +82,8 @@ static time_t lag_last_draw; /* mbox counter */ static SBAR_ITEM_REC *mail_item; static int mail_timetag, mail_last_count; -static time_t mail_last_mtime; +static time_t mail_last_mtime = -1; +static off_t mail_last_size = -1; /* topic */ static SBAR_ITEM_REC *topic_item; @@ -595,9 +596,11 @@ static int get_mail_count(void) if (stat(fname, &statbuf) != 0) return 0; - if (statbuf.st_mtime == mail_last_mtime) + if (statbuf.st_mtime == mail_last_mtime || + statbuf.st_size == mail_last_size) return mail_last_count; mail_last_mtime = statbuf.st_mtime; + mail_last_size = statbuf.st_size; f = fopen(fname, "r"); if (f == NULL) return 0; |