aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--worker/notmuch/eventhandlers.go2
-rw-r--r--worker/notmuch/worker.go6
2 files changed, 7 insertions, 1 deletions
diff --git a/worker/notmuch/eventhandlers.go b/worker/notmuch/eventhandlers.go
index 4eec1f60..7b3c5174 100644
--- a/worker/notmuch/eventhandlers.go
+++ b/worker/notmuch/eventhandlers.go
@@ -16,7 +16,7 @@ func (w *worker) handleNotmuchEvent(et eventType) error {
func (w *worker) handleUpdateDirCounts(ev eventType) error {
for name, query := range w.nameQueryMap {
- info, err := w.gatherDirectoryInfo(name, query)
+ info, err := w.buildDirInfo(name, query, true)
if err != nil {
logging.Errorf("could not gather DirectoryInfo: %v", err)
continue
diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go
index 6941809a..28029b26 100644
--- a/worker/notmuch/worker.go
+++ b/worker/notmuch/worker.go
@@ -212,11 +212,17 @@ func (w *worker) handleListDirectories(msg *types.ListDirectories) error {
func (w *worker) gatherDirectoryInfo(name string, query string) (
*types.DirectoryInfo, error) {
+ return w.buildDirInfo(name, query, false)
+}
+
+func (w *worker) buildDirInfo(name string, query string, skipSort bool) (
+ *types.DirectoryInfo, error) {
count, err := w.db.QueryCountMessages(query)
if err != nil {
return nil, err
}
info := &types.DirectoryInfo{
+ SkipSort: skipSort,
Info: &models.DirectoryInfo{
Name: name,
Flags: []string{},