Mercurial > dovecot > original-hg > dovecot-1.2
comparison src/imap/cmd-list.c @ 9021:e36a9edb5fb0 HEAD
Allow prefix="" namespace to have list=no and make it work in a somewhat useful way.
Based on patch by Mark Washenberger.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 09 May 2009 15:02:37 -0400 |
parents | 163c3f85a3aa |
children | db2fdf3529ac |
comparison
equal
deleted
inserted
replaced
9020:a6779d086785 | 9021:e36a9edb5fb0 |
---|---|
568 const char *p; | 568 const char *p; |
569 size_t len; | 569 size_t len; |
570 | 570 |
571 skip_namespace_prefix_pattern(ctx, &cur_ns_prefix, | 571 skip_namespace_prefix_pattern(ctx, &cur_ns_prefix, |
572 cur_ref, &cur_pattern); | 572 cur_ref, &cur_pattern); |
573 if (*cur_ns_prefix == '\0') | 573 if (*cur_ns_prefix == '\0') { |
574 return TRUE; | 574 /* no namespace prefix: if list=no we don't want to show |
575 anything, except when the client does e.g. LIST "" mailbox. | |
576 prefix="", list=no namespace is mainly useful for working | |
577 around client bugs. */ | |
578 if ((ns->flags & NAMESPACE_FLAG_LIST_PREFIX) == 0 && | |
579 list_pattern_has_wildcards(cur_pattern)) | |
580 return FALSE; | |
581 else | |
582 return TRUE; | |
583 } | |
575 | 584 |
576 /* namespace prefix still wasn't completely skipped over. | 585 /* namespace prefix still wasn't completely skipped over. |
577 for example cur_ns_prefix=INBOX/, pattern=%/% or pattern=IN%. | 586 for example cur_ns_prefix=INBOX/, pattern=%/% or pattern=IN%. |
578 Check that pattern matches namespace prefix. */ | 587 Check that pattern matches namespace prefix. */ |
579 i_assert(*cur_ref == '\0'); | 588 i_assert(*cur_ref == '\0'); |