diff options
author | Reto Brunner <reto@labrat.space> | 2019-06-12 08:31:51 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-06-14 10:42:24 -0400 |
commit | 626f91c4832c097b7036d5063b2f0491397a9c70 (patch) | |
tree | 786310a326cf120e1d4f630fe8ce74405579a9bb /worker/imap/list.go | |
parent | d3b5a76b4a8ad839991cb686711a0c0d24536d5e (diff) | |
download | aerc-626f91c4832c097b7036d5063b2f0491397a9c70.tar.gz |
imap: respect the folder config option
Diffstat (limited to 'worker/imap/list.go')
-rw-r--r-- | worker/imap/list.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/worker/imap/list.go b/worker/imap/list.go index 5e282ef7..552fb457 100644 --- a/worker/imap/list.go +++ b/worker/imap/list.go @@ -17,6 +17,19 @@ func (imapw *IMAPWorker) handleListDirectories(msg *types.ListDirectories) { // no need to pass this to handlers if it can't be opened continue } + if len(imapw.config.folders) > 0 { + // apply user filter + found := false + for _, folder := range imapw.config.folders { + if folder == mbox.Name || imapw.selected.Name == mbox.Name { + found = true + break + } + } + if !found { + continue + } + } imapw.worker.PostMessage(&types.Directory{ Message: types.RespondTo(msg), Name: mbox.Name, |