diff options
Diffstat (limited to 'worker')
-rw-r--r-- | worker/imap/checkmail.go | 6 | ||||
-rw-r--r-- | worker/imap/list.go | 6 | ||||
-rw-r--r-- | worker/maildir/worker.go | 7 | ||||
-rw-r--r-- | worker/mbox/models.go | 11 | ||||
-rw-r--r-- | worker/notmuch/worker.go | 7 |
5 files changed, 9 insertions, 28 deletions
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), diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go index c57f0d67..69d39fa8 100644 --- a/worker/maildir/worker.go +++ b/worker/maildir/worker.go @@ -186,17 +186,13 @@ func dirFiles(name string) ([]string, error) { func (w *Worker) getDirectoryInfo(name string) *models.DirectoryInfo { dirInfo := &models.DirectoryInfo{ - Name: name, - Flags: []string{}, - ReadOnly: false, + Name: name, // total messages Exists: 0, // new messages since mailbox was last opened Recent: 0, // total unread Unseen: 0, - - AccurateCounts: false, } dir := w.c.Store.Dir(name) @@ -263,7 +259,6 @@ func (w *Worker) getDirectoryInfo(name string) *models.DirectoryInfo { dirInfo.Recent++ } } - dirInfo.AccurateCounts = true return dirInfo } diff --git a/worker/mbox/models.go b/worker/mbox/models.go index 1546f01a..491128c5 100644 --- a/worker/mbox/models.go +++ b/worker/mbox/models.go @@ -42,13 +42,10 @@ func (md *mailboxContainer) DirectoryInfo(file string) *models.DirectoryInfo { exists = len(md.Uids()) } return &models.DirectoryInfo{ - Name: file, - Flags: []string{}, - ReadOnly: false, - Exists: exists, - Recent: 0, - Unseen: 0, - AccurateCounts: false, + Name: file, + Exists: exists, + Recent: 0, + Unseen: 0, } } diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go index 199eb64f..b25a8786 100644 --- a/worker/notmuch/worker.go +++ b/worker/notmuch/worker.go @@ -273,16 +273,13 @@ func (w *worker) handleListDirectories(msg *types.ListDirectories) error { func (w *worker) getDirectoryInfo(name string, query string) *models.DirectoryInfo { dirInfo := &models.DirectoryInfo{ - Name: name, - Flags: []string{}, - ReadOnly: false, + Name: name, // total messages Exists: 0, // new messages since mailbox was last opened Recent: 0, // total unread - Unseen: 0, - AccurateCounts: true, + Unseen: 0, } count, err := w.db.QueryCountMessages(query) |