check whether mailboxes have message/etc counts through an "upgrade" boolean flag

Instead of using the per-mailbox flag, and going through all mailboxes when
opening an account.
This commit is contained in:
Mechiel Lukkien
2025-03-23 12:45:21 +01:00
parent b37faa06bd
commit a68a9d8a48
4 changed files with 36 additions and 29 deletions

2
ctl.go
View File

@ -1522,7 +1522,7 @@ func servectlcmd(ctx context.Context, ctl *ctl, cid int64, shutdown func()) {
}
totalSize += mc.Size
if !mb.HaveCounts || mc != mb.MailboxCounts {
if mc != mb.MailboxCounts {
_, err := fmt.Fprintf(w, "for %s setting new counts %s (was %s)\n", mb.Name, mc, mb.MailboxCounts)
ctl.xcheck(err, "write")
mb.HaveCounts = true