summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-06-07 15:22:26 -0500
committerRobin Jarry <robin@jarry.cc>2022-06-14 22:12:31 +0200
commited005f770c9976877fa4838616a386a2501503f2 (patch)
tree81be166c63bd77faa58897ec7bb39b98247057c7
parent83e0e2638df9da0801af7ad35058938dc8eb1cdc (diff)
downloadaerc-ed005f770c9976877fa4838616a386a2501503f2.zip
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>
-rw-r--r--widgets/dirlist.go19
1 files changed, 8 insertions, 11 deletions
diff --git a/widgets/dirlist.go b/widgets/dirlist.go
index 2c761a5..2168e19 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
}