about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/msgstore.go2
-rw-r--r--worker/imap/create.go5
-rw-r--r--worker/types/messages.go1
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/msgstore.go b/lib/msgstore.go
index 038c3ca..27b63f3 100644
--- a/lib/msgstore.go
+++ b/lib/msgstore.go
@@ -236,6 +236,7 @@ func (store *MessageStore) Copy(uids []uint32, dest string, createDest bool,
 	if createDest {
 		store.worker.PostAction(&types.CreateDirectory{
 			Directory: dest,
+			Quiet:     true,
 		}, cb)
 	}
 
@@ -255,6 +256,7 @@ func (store *MessageStore) Move(uids []uint32, dest string, createDest bool,
 	if createDest {
 		store.worker.PostAction(&types.CreateDirectory{
 			Directory: dest,
+			Quiet:     true,
 		}, cb)
 	}
 
diff --git a/worker/imap/create.go b/worker/imap/create.go
index 3cc71c5..6ce71ef 100644
--- a/worker/imap/create.go
+++ b/worker/imap/create.go
@@ -1,15 +1,12 @@
 package imap
 
 import (
-	"strings"
-
 	"git.sr.ht/~sircmpwn/aerc/worker/types"
 )
 
 func (imapw *IMAPWorker) handleCreateDirectory(msg *types.CreateDirectory) {
 	if err := imapw.client.Create(msg.Directory); err != nil {
-		if strings.HasPrefix(err.Error(), "Mailbox already exists") {
-			// ignore "already exists" error
+		if msg.Quiet {
 			return
 		}
 		imapw.worker.PostMessage(&types.Error{
diff --git a/worker/types/messages.go b/worker/types/messages.go
index bab14e0..34a1e5c 100644
--- a/worker/types/messages.go
+++ b/worker/types/messages.go
@@ -90,6 +90,7 @@ type SearchDirectory struct {
 type CreateDirectory struct {
 	Message
 	Directory string
+	Quiet     bool
 }
 
 type FetchMessageHeaders struct {
#n175'>175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216