From 5b0a98b8c936532fa5444b1cabf53d7c929d19c1 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Sun, 16 Apr 2023 09:53:44 -0500 Subject: directory: use directory to store rue counts Store the Directory RUE counts on the Directory data model. Use DirectoryInfo messages to update the Directory model. Access Directories via the dirlist instead of via the msgstore. Remove unused fields on DirectoryInfo, all backends now give accurate counts. Move refetch logic into dirlist Signed-off-by: Tim Culverhouse Acked-by: Robin Jarry --- worker/imap/checkmail.go | 6 +----- worker/imap/list.go | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'worker/imap') diff --git a/worker/imap/checkmail.go b/worker/imap/checkmail.go index 05441a3c..76da58ad 100644 --- a/worker/imap/checkmail.go +++ b/worker/imap/checkmail.go @@ -58,11 +58,7 @@ func (w *IMAPWorker) handleCheckMailMessage(msg *types.CheckMail) { } w.worker.PostMessage(&types.DirectoryInfo{ Info: &models.DirectoryInfo{ - Flags: status.Flags, - Name: status.Name, - ReadOnly: status.ReadOnly, - AccurateCounts: true, - + Name: status.Name, Exists: int(status.Messages), Recent: int(status.Recent), Unseen: int(status.Unseen), diff --git a/worker/imap/list.go b/worker/imap/list.go index 07aa2971..657779e5 100644 --- a/worker/imap/list.go +++ b/worker/imap/list.go @@ -56,11 +56,7 @@ func (imapw *IMAPWorker) handleListDirectories(msg *types.ListDirectories) { for _, status := range statuses { imapw.worker.PostMessage(&types.DirectoryInfo{ Info: &models.DirectoryInfo{ - Flags: status.Flags, - Name: status.Name, - ReadOnly: status.ReadOnly, - AccurateCounts: true, - + Name: status.Name, Exists: int(status.Messages), Recent: int(status.Recent), Unseen: int(status.Unseen), -- cgit