#190 Handle gmail duplicate folder
This commit is contained in:
parent
0b3aca4167
commit
06da4512b9
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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{
|
||||
|
|
|
@ -90,6 +90,7 @@ type SearchDirectory struct {
|
|||
type CreateDirectory struct {
|
||||
Message
|
||||
Directory string
|
||||
Quiet bool
|
||||
}
|
||||
|
||||
type FetchMessageHeaders struct {
|
||||
|
|
Loading…
Reference in New Issue