From 2750f99a6049322b1361b5bfa4dff3b1df2b36ab Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 13 Jan 2019 16:18:10 -0500 Subject: Issue IMAP SELECT command --- worker/imap/open.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 worker/imap/open.go (limited to 'worker/imap/open.go') diff --git a/worker/imap/open.go b/worker/imap/open.go new file mode 100644 index 00000000..d90a292c --- /dev/null +++ b/worker/imap/open.go @@ -0,0 +1,20 @@ +package imap + +import ( + "git.sr.ht/~sircmpwn/aerc2/worker/types" +) + +func (imapw *IMAPWorker) handleOpenDirectory(msg *types.OpenDirectory) { + imapw.worker.Logger.Printf("Opening %s", msg.Directory) + go func() { + _, err := imapw.client.Select(msg.Directory, false) + if 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