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>
This commit is contained in:
parent
83e0e2638d
commit
ed005f770c
1 changed files with 8 additions and 11 deletions
|
@ -249,20 +249,17 @@ func (dirlist *DirectoryList) getRUEString(name string) string {
|
||||||
if !ok {
|
if !ok {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
var totalRecent, totalUnseen, totalExists int
|
|
||||||
if !msgStore.DirInfo.AccurateCounts {
|
if !msgStore.DirInfo.AccurateCounts {
|
||||||
totalRecent, totalUnseen = countRUE(msgStore)
|
msgStore.DirInfo.Recent, msgStore.DirInfo.Unseen = countRUE(msgStore)
|
||||||
msgStore.DirInfo.Recent = totalRecent
|
|
||||||
msgStore.DirInfo.Unseen = totalUnseen
|
|
||||||
}
|
}
|
||||||
totalExists = msgStore.DirInfo.Exists
|
di := msgStore.DirInfo
|
||||||
rueString := ""
|
rueString := ""
|
||||||
if totalRecent > 0 {
|
if di.Recent > 0 {
|
||||||
rueString = fmt.Sprintf("%d/%d/%d", totalRecent, totalUnseen, totalExists)
|
rueString = fmt.Sprintf("%d/%d/%d", di.Recent, di.Unseen, di.Exists)
|
||||||
} else if totalUnseen > 0 {
|
} else if di.Unseen > 0 {
|
||||||
rueString = fmt.Sprintf("%d/%d", totalUnseen, totalExists)
|
rueString = fmt.Sprintf("%d/%d", di.Unseen, di.Exists)
|
||||||
} else if totalExists > 0 {
|
} else if di.Exists > 0 {
|
||||||
rueString = fmt.Sprintf("%d", totalExists)
|
rueString = fmt.Sprintf("%d", di.Exists)
|
||||||
}
|
}
|
||||||
return rueString
|
return rueString
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue