summary refs log tree commit diff stats
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)
 				}
 			}
 		}
ani-tty/commit/tests/test_cmd_rooms.c?id=8685e78c86ecd579078aaad961bd23eaba5e3e84'>8685e78c ^
2490f5b4 ^
71577c1f ^
81190251 ^

447d2358 ^
71577c1f ^
7db1bcee ^

d56f6dc3 ^
5c65599e ^
81190251 ^
447d2358 ^
447d2358 ^




























5c65599e ^
49661625 ^


447d2358 ^
7db1bcee ^



00a475cf ^
7db1bcee ^
5c65599e ^
81190251 ^
3e3786eb ^
71577c1f ^

bf347ab9 ^
447d2358 ^
5c65599e ^
447d2358 ^
7db1bcee ^
00a475cf ^
7db1bcee ^
5c65599e ^
81190251 ^
447d2358 ^
447d2358 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82