aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-07-04 12:31:27 -0400
committerDrew DeVault <sir@cmpwn.com>2019-07-04 12:31:27 -0400
commitf7387f8c60d140b8b1c7236dfc2aa8d0471d05e7 (patch)
treea45c783c2e42825f25d79e58135910fee5cf1824
parentb12eba55c3cac7e754d1a17c4da4ffa230846af9 (diff)
Sort out dirstore once and for all
-rw-r--r--lib/dirstore.go4
-rw-r--r--widgets/dirlist.go1
-rw-r--r--worker/imap/list.go13
3 files changed, 2 insertions, 16 deletions
diff --git a/lib/dirstore.go b/lib/dirstore.go
index e7ebb77..862e97a 100644
--- a/lib/dirstore.go
+++ b/lib/dirstore.go
@@ -5,9 +5,7 @@ type DirStore struct {
}
func NewDirStore() *DirStore {
- return &DirStore{
- dirs: make([]string, 0),
- }
+ return &DirStore{}
}
func (store *DirStore) Update(dirs []string) {
diff --git a/widgets/dirlist.go b/widgets/dirlist.go
index 01adfe7..4dc8fd2 100644
--- a/widgets/dirlist.go
+++ b/widgets/dirlist.go
@@ -48,6 +48,7 @@ func (dirlist *DirectoryList) List() []string {
}
func (dirlist *DirectoryList) UpdateList(done func(dirs []string)) {
+ // TODO: move this logic into dirstore
var dirs []string
dirlist.worker.PostAction(
&types.ListDirectories{}, func(msg types.WorkerMessage) {
diff --git a/worker/imap/list.go b/worker/imap/list.go
index b9578ab..708e70f 100644
--- a/worker/imap/list.go
+++ b/worker/imap/list.go
@@ -17,19 +17,6 @@ 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,