diff options
author | Julian Pidancet <julian.pidancet@oracle.com> | 2022-10-26 22:29:05 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-10-27 21:45:31 +0200 |
commit | fbff8cf0ac577d5e7d981b54efd2919212fd1db1 (patch) | |
tree | 3c0ff54dadae14b2a435e64a0ec33e30e28fcce1 /worker/notmuch/eventhandlers.go | |
parent | c7bfe4e490fb1fcf779edceb23c96301eb763b47 (diff) | |
download | aerc-fbff8cf0ac577d5e7d981b54efd2919212fd1db1.tar.gz |
notmuch: make maildir store path configurable
Add the "maildir-store" account configuration option to select the
maildir store to associate with the notmuch database.
This also allows the previous changes to be backward compatible since
not specifying this option will make the backend behave the same as if
there were no changes.
Fixes: https://todo.sr.ht/~rjarry/aerc/73
Signed-off-by: Julian Pidancet <julian.pidancet@oracle.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Acked-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'worker/notmuch/eventhandlers.go')
-rw-r--r-- | worker/notmuch/eventhandlers.go | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/worker/notmuch/eventhandlers.go b/worker/notmuch/eventhandlers.go index 764add0c..ab180467 100644 --- a/worker/notmuch/eventhandlers.go +++ b/worker/notmuch/eventhandlers.go @@ -20,19 +20,21 @@ func (w *worker) handleNotmuchEvent(et eventType) error { } func (w *worker) handleUpdateDirCounts(ev eventType) error { - folders, err := w.store.FolderMap() - if err != nil { - logging.Errorf("failed listing directories: %v", err) - return err - } - for name := range folders { - query := fmt.Sprintf("folder:%s", strconv.Quote(name)) - info, err := w.buildDirInfo(name, query, true) + if w.store != nil { + folders, err := w.store.FolderMap() if err != nil { - logging.Errorf("could not gather DirectoryInfo: %v", err) - continue + logging.Errorf("failed listing directories: %v", err) + return err + } + for name := range folders { + query := fmt.Sprintf("folder:%s", strconv.Quote(name)) + info, err := w.buildDirInfo(name, query, true) + if err != nil { + logging.Errorf("could not gather DirectoryInfo: %v", err) + continue + } + w.w.PostMessage(info, nil) } - w.w.PostMessage(info, nil) } for name, query := range w.nameQueryMap { |