plugins/base: always show INBOX first

This commit is contained in:
Simon Ser 2020-03-27 13:19:26 +01:00
parent 6395be6737
commit 4cf5ad68af
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
1 changed files with 6 additions and 0 deletions

View File

@ -54,6 +54,12 @@ func listMailboxes(conn *imapclient.Client) ([]MailboxInfo, error) {
}
sort.Slice(mailboxes, func(i, j int) bool {
if mailboxes[i].Name == "INBOX" {
return true
}
if mailboxes[j].Name == "INBOX" {
return false
}
return mailboxes[i].Name < mailboxes[j].Name
})
return mailboxes, nil