Skip to content

Commit

Permalink
lib-storage: Add mail_namespace_is_inbox_noinferiors()
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Dec 14, 2017
1 parent 50ba09c commit 9a2149c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lib-storage/mail-namespace.h
Expand Up @@ -190,4 +190,16 @@ void mail_namespace_finish_list_init(struct mail_namespace *ns,
type=public namespace "wrong"). */
bool mail_namespace_is_shared_user_root(struct mail_namespace *ns);

/* Returns TRUE if namespace includes INBOX that should be \Noinferiors.
This happens when the namespace has a prefix, which is not empty and not
"INBOX". This happens, because if storage_name=INBOX/foo it would be
converted to vname=prefix/INBOX/foo. */
static inline bool
mail_namespace_is_inbox_noinferiors(struct mail_namespace *ns)
{
return (ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0 &&
ns->prefix_len > 0 &&
strncmp(ns->prefix, "INBOX", ns->prefix_len-1) != 0;
}

#endif

0 comments on commit 9a2149c

Please sign in to comment.