#190 Handle gmail duplicate folder

This commit is contained in:
Daniel Bridges 2019-07-10 21:49:09 -07:00 committed by Drew DeVault
parent 0b3aca4167
commit 06da4512b9
3 changed files with 4 additions and 4 deletions

View File

@ -236,6 +236,7 @@ func (store *MessageStore) Copy(uids []uint32, dest string, createDest bool,
if createDest { if createDest {
store.worker.PostAction(&types.CreateDirectory{ store.worker.PostAction(&types.CreateDirectory{
Directory: dest, Directory: dest,
Quiet: true,
}, cb) }, cb)
} }
@ -255,6 +256,7 @@ func (store *MessageStore) Move(uids []uint32, dest string, createDest bool,
if createDest { if createDest {
store.worker.PostAction(&types.CreateDirectory{ store.worker.PostAction(&types.CreateDirectory{
Directory: dest, Directory: dest,
Quiet: true,
}, cb) }, cb)
} }

View File

@ -1,15 +1,12 @@
package imap package imap
import ( import (
"strings"
"git.sr.ht/~sircmpwn/aerc/worker/types" "git.sr.ht/~sircmpwn/aerc/worker/types"
) )
func (imapw *IMAPWorker) handleCreateDirectory(msg *types.CreateDirectory) { func (imapw *IMAPWorker) handleCreateDirectory(msg *types.CreateDirectory) {
if err := imapw.client.Create(msg.Directory); err != nil { if err := imapw.client.Create(msg.Directory); err != nil {
if strings.HasPrefix(err.Error(), "Mailbox already exists") { if msg.Quiet {
// ignore "already exists" error
return return
} }
imapw.worker.PostMessage(&types.Error{ imapw.worker.PostMessage(&types.Error{

View File

@ -90,6 +90,7 @@ type SearchDirectory struct {
type CreateDirectory struct { type CreateDirectory struct {
Message Message
Directory string Directory string
Quiet bool
} }
type FetchMessageHeaders struct { type FetchMessageHeaders struct {