aboutsummaryrefslogtreecommitdiffstats
path: root/worker/imap/remove.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/imap/remove.go')
-rw-r--r--worker/imap/remove.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/worker/imap/remove.go b/worker/imap/remove.go
new file mode 100644
index 00000000..47b1f437
--- /dev/null
+++ b/worker/imap/remove.go
@@ -0,0 +1,19 @@
+package imap
+
+import (
+ "git.sr.ht/~sircmpwn/aerc/worker/types"
+)
+
+func (imapw *IMAPWorker) handleRemoveDirectory(msg *types.RemoveDirectory) {
+ if err := imapw.client.Delete(msg.Directory); err != nil {
+ if msg.Quiet {
+ return
+ }
+ imapw.worker.PostMessage(&types.Error{
+ Message: types.RespondTo(msg),
+ Error: err,
+ }, nil)
+ } else {
+ imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil)
+ }
+}