Mercurial > dovecot > original-hg > dovecot-1.2
changeset 7830:5a6aa66e2ccd HEAD
dbox: Set MAILBOX_NOCHILDREN flag for selectable mailboxes if we know it.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 12 Jun 2008 02:08:16 +0300 |
parents | 1550dc4f24a5 |
children | b2d18f10b5a7 |
files | src/lib-storage/index/dbox/dbox-storage.c |
diffstat | 1 files changed, 6 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/dbox/dbox-storage.c Thu Jun 12 02:03:17 2008 +0300 +++ b/src/lib-storage/index/dbox/dbox-storage.c Thu Jun 12 02:08:16 2008 +0300 @@ -634,11 +634,14 @@ if ((*flags & (MAILBOX_NOSELECT | MAILBOX_NONEXISTENT)) == 0) { /* make sure it's a selectable mailbox */ maildir_path = t_strconcat(path, "/"DBOX_MAILDIR_NAME, NULL); - if (stat(maildir_path, &st2) < 0 || !S_ISDIR(st2.st_mode)) { + if (stat(maildir_path, &st2) < 0 || !S_ISDIR(st2.st_mode)) *flags |= MAILBOX_NOSELECT; - if (st.st_nlink == 3 && - *ctx->list->set.maildir_name != '\0') + if (st.st_nlink == 3 && *ctx->list->set.maildir_name != '\0') { + /* now we know what link count 3 means. */ + if ((*flags & MAILBOX_NOSELECT) != 0) *flags |= MAILBOX_CHILDREN; + else + *flags |= MAILBOX_NOCHILDREN; } } return ret;