Force INBOX to be included in dirlist
This commit is contained in:
parent
db213fd0ae
commit
07138146a0
1 changed files with 11 additions and 0 deletions
|
@ -47,6 +47,17 @@ func (dirlist *DirectoryList) UpdateList(done func(dirs []string)) {
|
||||||
case *types.Directory:
|
case *types.Directory:
|
||||||
dirs = append(dirs, msg.Name)
|
dirs = append(dirs, msg.Name)
|
||||||
case *types.Done:
|
case *types.Done:
|
||||||
|
// There is always an INBOX, RFC-guaranteed
|
||||||
|
// However, for some reason Dovecot doesn't always send it.
|
||||||
|
inbox := false
|
||||||
|
for _, dir := range dirs {
|
||||||
|
if dir == "INBOX" {
|
||||||
|
inbox = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !inbox {
|
||||||
|
dirs = append(dirs, "INBOX")
|
||||||
|
}
|
||||||
sort.Strings(dirs)
|
sort.Strings(dirs)
|
||||||
dirlist.dirs = dirs
|
dirlist.dirs = dirs
|
||||||
dirlist.spinner.Stop()
|
dirlist.spinner.Stop()
|
||||||
|
|
Loading…
Reference in a new issue