diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2022-06-07 15:22:26 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-06-14 22:12:31 +0200 |
commit | ed005f770c9976877fa4838616a386a2501503f2 (patch) | |
tree | 81be166c63bd77faa58897ec7bb39b98247057c7 /widgets | |
parent | 83e0e2638df9da0801af7ad35058938dc8eb1cdc (diff) | |
download | aerc-ed005f770c9976877fa4838616a386a2501503f2.tar.gz |
dirlist: fix ruestring counts from checkmail
Commit 8b6f971 broke ruestring counts when AccurateCounts=true, which
primarily occur from a checkmail. This restores the functionality.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/dirlist.go | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/widgets/dirlist.go b/widgets/dirlist.go index 2c761a5c..2168e198 100644 --- a/widgets/dirlist.go +++ b/widgets/dirlist.go @@ -249,20 +249,17 @@ func (dirlist *DirectoryList) getRUEString(name string) string { if !ok { return "" } - var totalRecent, totalUnseen, totalExists int if !msgStore.DirInfo.AccurateCounts { - totalRecent, totalUnseen = countRUE(msgStore) - msgStore.DirInfo.Recent = totalRecent - msgStore.DirInfo.Unseen = totalUnseen + msgStore.DirInfo.Recent, msgStore.DirInfo.Unseen = countRUE(msgStore) } - totalExists = msgStore.DirInfo.Exists + di := msgStore.DirInfo rueString := "" - if totalRecent > 0 { - rueString = fmt.Sprintf("%d/%d/%d", totalRecent, totalUnseen, totalExists) - } else if totalUnseen > 0 { - rueString = fmt.Sprintf("%d/%d", totalUnseen, totalExists) - } else if totalExists > 0 { - rueString = fmt.Sprintf("%d", totalExists) + if di.Recent > 0 { + rueString = fmt.Sprintf("%d/%d/%d", di.Recent, di.Unseen, di.Exists) + } else if di.Unseen > 0 { + rueString = fmt.Sprintf("%d/%d", di.Unseen, di.Exists) + } else if di.Exists > 0 { + rueString = fmt.Sprintf("%d", di.Exists) } return rueString } |