Sort out dirstore once and for all
This commit is contained in:
parent
b12eba55c3
commit
f7387f8c60
|
@ -5,9 +5,7 @@ type DirStore struct {
|
|||
}
|
||||
|
||||
func NewDirStore() *DirStore {
|
||||
return &DirStore{
|
||||
dirs: make([]string, 0),
|
||||
}
|
||||
return &DirStore{}
|
||||
}
|
||||
|
||||
func (store *DirStore) Update(dirs []string) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue