diff options
Diffstat (limited to 'worker/notmuch/eventhandlers.go')
-rw-r--r-- | worker/notmuch/eventhandlers.go | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/worker/notmuch/eventhandlers.go b/worker/notmuch/eventhandlers.go index 39027b6a..e279dbc4 100644 --- a/worker/notmuch/eventhandlers.go +++ b/worker/notmuch/eventhandlers.go @@ -2,8 +2,21 @@ package notmuch func (w *worker) handleNotmuchEvent(et eventType) error { switch ev := et.(type) { + case *updateDirCounts: + return w.handleUpdateDirCounts(ev) default: - _ = ev return errUnsupported } } + +func (w *worker) handleUpdateDirCounts(ev eventType) error { + for name, query := range w.nameQueryMap { + info, err := w.gatherDirectoryInfo(name, query) + if err != nil { + w.w.Logger.Printf("could not gather DirectoryInfo: %v\n", err) + continue + } + w.w.PostMessage(info, nil) + } + return nil +} |