summary refs log tree commit diff stats
path: root/widgets
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-05-14 16:53:47 -0400
committerDrew DeVault <sir@cmpwn.com>2019-05-14 16:53:47 -0400
commit07138146a01d802e4d1b5a7d0ccf4601d89eeef8 (patch)
tree7792f3361e349116c8210a9ef377e24f22c3087a /widgets
parentdb213fd0aed98a79ecb1be2c7b7d61c7d983bedf (diff)
downloadaerc-07138146a01d802e4d1b5a7d0ccf4601d89eeef8.tar.gz
Force INBOX to be included in dirlist
Diffstat (limited to 'widgets')
-rw-r--r--widgets/dirlist.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/widgets/dirlist.go b/widgets/dirlist.go
index faf73a1..689eb77 100644
--- a/widgets/dirlist.go
+++ b/widgets/dirlist.go
@@ -47,6 +47,17 @@ func (dirlist *DirectoryList) UpdateList(done func(dirs []string)) {
 			case *types.Directory:
 				dirs = append(dirs, msg.Name)
 			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)
 				dirlist.dirs = dirs
 				dirlist.spinner.Stop()
'n152' href='#n152'>152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192