about summary refs log tree commit homepage
path: root/lib/PublicInbox/IMAPD.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-06-10 07:04:41 +0000
committerEric Wong <e@yhbt.net>2020-06-13 07:55:45 +0000
commit4d1a787a0a3c27a11c266b2f76293d09b858b38e (patch)
tree2f4797eae081b2eb86fde4bb32d36cb61b5c94fb /lib/PublicInbox/IMAPD.pm
parentcfae078171fc1453be0795e4ba5f0252627ebba3 (diff)
downloadpublic-inbox-4d1a787a0a3c27a11c266b2f76293d09b858b38e.tar.gz
I'm not sure this matters, and it could be a waste of
CPU cycles if no real clients care.  However, it does
make debugging over telnet or s_client a bit easier.
Diffstat (limited to 'lib/PublicInbox/IMAPD.pm')
-rw-r--r--lib/PublicInbox/IMAPD.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/PublicInbox/IMAPD.pm b/lib/PublicInbox/IMAPD.pm
index b647c940..6488dc0f 100644
--- a/lib/PublicInbox/IMAPD.pm
+++ b/lib/PublicInbox/IMAPD.pm
@@ -72,7 +72,12 @@ sub imapd_refresh_finalize {
                 map {
                         my $no = $mailboxes->{$_} == $dummy ? '' : 'No';
                         qq[* LIST (\\Has${no}Children) "." $_\r\n]
-                } sort { length($a) <=> length($b) } keys %$mailboxes
+                } sort {
+                        # shortest names first, alphabetically if lengths match
+                        length($a) == length($b) ?
+                                ($a cmp $b) :
+                                (length($a) <=> length($b))
+                } keys %$mailboxes
         ];
         $imapd->{pi_config} = $pi_config;
         if (my $idler = $imapd->{idler}) {