aerc

Working clone of aerc-mail.org
git clone git://git.danielmoch.com/aerc.git
Log | Files | Refs | README | LICENSE

commit 3a5b4c229e42c14b1389cd985506d09b3f17388b
parent e85ef71935c145307b67cf6af2477d1c2d041075
Author: Drew DeVault <sir@cmpwn.com>
Date:   Sun,  2 Jun 2019 13:29:40 -0400

Wait for listing to complete before sending Done

Diffstat:
Mworker/imap/list.go | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/worker/imap/list.go b/worker/imap/list.go @@ -9,6 +9,7 @@ import ( func (imapw *IMAPWorker) handleListDirectories(msg *types.ListDirectories) { mailboxes := make(chan *imap.MailboxInfo) imapw.worker.Logger.Println("Listing mailboxes") + done := make(chan interface{}) go func() { for mbox := range mailboxes { @@ -22,9 +23,11 @@ func (imapw *IMAPWorker) handleListDirectories(msg *types.ListDirectories) { Attributes: mbox.Attributes, }, nil) } + done <- nil }() if err := imapw.client.List("", "*", mailboxes); err != nil { + <-done imapw.worker.PostMessage(&types.Error{ Message: types.RespondTo(msg), Error: err,