about summary refs log tree commit diff stats
path: root/worker/maildir
diff options
context:
space:
mode:
authorJeffas <dev@jeffas.io>2020-03-02 20:00:14 +0000
committerDrew DeVault <sir@cmpwn.com>2020-03-09 09:13:46 -0400
commit08eabef17d8b8f984e4ba796579bc8ef9cc11de9 (patch)
treec988d380bedde33c715234d5f0ae7ecf0c5a8e54 /worker/maildir
parentae7595e945e3fd3abd46aceba1e09c0a1f6249e4 (diff)
downloadaerc-08eabef17d8b8f984e4ba796579bc8ef9cc11de9.tar.gz
Count recent messages in maildir exists total too
Diffstat (limited to 'worker/maildir')
-rw-r--r--worker/maildir/worker.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go
index 2f96e6f..34d73f8 100644
--- a/worker/maildir/worker.go
+++ b/worker/maildir/worker.go
@@ -136,7 +136,6 @@ func (w *Worker) getDirectoryInfo(name string) *models.DirectoryInfo {
 		w.worker.Logger.Printf("could not get uids: %v", err)
 		return dirInfo
 	}
-	dirInfo.Exists = len(uids)
 
 	recent, err := dir.UnseenCount()
 	if err != nil {
@@ -166,6 +165,7 @@ func (w *Worker) getDirectoryInfo(name string) *models.DirectoryInfo {
 		}
 	}
 	dirInfo.Unseen += dirInfo.Recent
+	dirInfo.Exists = len(uids) + recent
 	return dirInfo
 }