aboutsummaryrefslogtreecommitdiff
path: root/worker/imap/list.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/imap/list.go')
-rw-r--r--worker/imap/list.go12
1 files changed, 8 insertions, 4 deletions
diff --git a/worker/imap/list.go b/worker/imap/list.go
index f6d3677..2f5e5b4 100644
--- a/worker/imap/list.go
+++ b/worker/imap/list.go
@@ -6,7 +6,7 @@ import (
"git.sr.ht/~sircmpwn/aerc2/worker/types"
)
-func (imapw *IMAPWorker) handleListDirectories(msg types.ListDirectories) {
+func (imapw *IMAPWorker) handleListDirectories(msg *types.ListDirectories) {
mailboxes := make(chan *imap.MailboxInfo)
done := make(chan error, 1)
imapw.worker.Logger.Println("Listing mailboxes")
@@ -18,18 +18,22 @@ func (imapw *IMAPWorker) handleListDirectories(msg types.ListDirectories) {
select {
case err := <-done:
if err != nil {
- imapw.worker.PostMessage(types.Error{
+ imapw.worker.PostMessage(&types.Error{
Message: types.RespondTo(msg),
Error: err,
}, nil)
} else {
imapw.worker.PostMessage(
- types.Done{types.RespondTo(msg)}, nil)
+ &types.Done{types.RespondTo(msg)}, nil)
}
return
case mbox := <-mailboxes:
if mbox != nil {
- imapw.worker.Logger.Printf("%v\n", mbox.Name)
+ imapw.worker.PostMessage(&types.Directory{
+ Message: types.RespondTo(msg),
+ Name: mbox.Name,
+ Attributes: mbox.Attributes,
+ }, nil)
}
}
}