aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2023-11-27 17:48:40 +0100
committerRobin Jarry <robin@jarry.cc>2023-12-30 14:11:34 +0100
commit81d9af9a5d33279d7dd99965f1dcb4349e528f96 (patch)
tree29254e6de7d789a81ef419b606b687f0b21e5a53
parentbd29700e708de7f99b17744c2015debe17a0234b (diff)
downloadaerc-81d9af9a5d33279d7dd99965f1dcb4349e528f96.tar.gz
notmuch: remove dynamic folders
Remove dynamic folders in the notmuch backends with the :rmdir command. Dynamic folders can be created by the :cf command but they cannot be removed again unless you restart aerc or use it in combination with a maildir-store. Signed-off-by: Koni Marti <koni.marti@gmail.com> Tested-by: Inwit <inwit@sindominio.net> Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r--worker/notmuch/worker.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go
index 486312a1..374a20b7 100644
--- a/worker/notmuch/worker.go
+++ b/worker/notmuch/worker.go
@@ -920,10 +920,16 @@ func (w *worker) handleCreateDirectory(msg *types.CreateDirectory) error {
}
func (w *worker) handleRemoveDirectory(msg *types.RemoveDirectory) error {
- if w.store == nil {
+ _, inQueryMap := w.nameQueryMap[msg.Directory]
+ if inQueryMap {
return errUnsupported
}
+ if w.store == nil {
+ w.done(msg)
+ return nil
+ }
+
dir := w.store.Dir(msg.Directory)
if err := os.RemoveAll(string(dir)); err != nil {
w.w.Errorf("could not remove directory %s: %v",