From db213fd0aed98a79ecb1be2c7b7d61c7d983bedf Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Tue, 14 May 2019 16:34:42 -0400 Subject: Implement :copy (aka :cp) --- worker/imap/movecopy.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 worker/imap/movecopy.go (limited to 'worker/imap/movecopy.go') diff --git a/worker/imap/movecopy.go b/worker/imap/movecopy.go new file mode 100644 index 0000000..8c42a2e --- /dev/null +++ b/worker/imap/movecopy.go @@ -0,0 +1,16 @@ +package imap + +import ( + "git.sr.ht/~sircmpwn/aerc2/worker/types" +) + +func (imapw *IMAPWorker) handleCopyMessages(msg *types.CopyMessages) { + if err := imapw.client.UidCopy(&msg.Uids, msg.Destination); err != nil { + imapw.worker.PostMessage(&types.Error{ + Message: types.RespondTo(msg), + Error: err, + }, nil) + } else { + imapw.worker.PostMessage(&types.Done{types.RespondTo(msg)}, nil) + } +} -- cgit v1.2.3