diff options
Diffstat (limited to 'worker/imap/movecopy.go')
-rw-r--r-- | worker/imap/movecopy.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/worker/imap/movecopy.go b/worker/imap/movecopy.go index 1d25c08c..d3df133a 100644 --- a/worker/imap/movecopy.go +++ b/worker/imap/movecopy.go @@ -46,3 +46,20 @@ func (imapw *IMAPWorker) handleAppendMessage(msg *types.AppendMessage) { imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) } } + +func (imapw *IMAPWorker) handleMoveMessages(msg *types.MoveMessages) { + uids := toSeqSet(msg.Uids) + if err := imapw.client.UidMove(uids, msg.Destination); err != nil { + imapw.worker.PostMessage(&types.Error{ + Message: types.RespondTo(msg), + Error: err, + }, nil) + } else { + imapw.worker.PostMessage(&types.MessagesMoved{ + Message: types.RespondTo(msg), + Destination: msg.Destination, + Uids: msg.Uids, + }, nil) + imapw.worker.PostMessage(&types.Done{Message: types.RespondTo(msg)}, nil) + } +} |