aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-03-27 13:19:26 +0100
committerSimon Ser <contact@emersion.fr>2020-03-27 13:19:26 +0100
commit4cf5ad68afd80f27512c464843b0d917182ef0c2 (patch)
tree53f491d488701a5d10f06c931ab66363a187ef34
parent6395be67375f85f3b9aa5b5c3203405cbabcd5de (diff)
downloadalps-4cf5ad68afd80f27512c464843b0d917182ef0c2.tar.gz
alps-4cf5ad68afd80f27512c464843b0d917182ef0c2.zip
plugins/base: always show INBOX first
-rwxr-xr-xplugins/base/imap.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/base/imap.go b/plugins/base/imap.go
index 760138b..14409eb 100755
--- a/plugins/base/imap.go
+++ b/plugins/base/imap.go
@@ -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