Lines Matching refs:ns

14 	struct mail_namespace *ns, *first_ns = NULL;
19 for (ns = brain->user->namespaces; ns != NULL; ns = ns->next) {
20 if (!dsync_brain_want_namespace(brain, ns))
23 sep = mail_namespace_get_sep(ns);
26 first_ns = ns;
31 sep, ns->prefix);
44 struct mail_namespace *ns;
55 for (ns = brain->user->namespaces; ns != NULL; ns = ns->next) {
56 if (!dsync_brain_want_namespace(brain, ns))
61 ns->prefix, ns->set->location);
62 if (dsync_mailbox_tree_fill(brain->local_mailbox_tree, ns,
123 dsync_namespace_match_parts(struct mail_namespace *ns,
126 const char *part, *prefix = ns->prefix;
128 char ns_sep = mail_namespace_get_sep(ns);
130 if ((ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0 &&
158 struct mail_namespace *ns, *best_ns = NULL;
160 for (ns = brain->user->namespaces; ns != NULL; ns = ns->next) {
161 if (!dsync_brain_want_namespace(brain, ns))
164 if (ns->prefix_len == 0) {
167 best_ns = ns;
168 } else if (dsync_namespace_match_parts(ns, name_parts)) {
170 best_ns->prefix_len < ns->prefix_len)
171 best_ns = ns;
178 dsync_is_valid_name(struct mail_namespace *ns, const char *vname)
183 box = mailbox_alloc(ns->list, vname, MAILBOX_FLAG_READONLY);
190 dsync_fix_mailbox_name(struct mail_namespace *ns, string_t *vname_str,
194 char *vname, list_sep = mailbox_list_get_hierarchy_sep(ns->list);
199 if (strncmp(vname, ns->prefix, ns->prefix_len) == 0)
200 start_pos = ns->prefix_len;
218 if (dsync_is_valid_name(ns, vname))
223 if (list_sep != mail_namespace_get_sep(ns)) {
228 if (dsync_is_valid_name(ns, vname))
232 if (mail_namespace_get_sep(ns) != '/' && list_sep != '/') {
237 if (dsync_is_valid_name(ns, vname))
241 str_insert(vname_str, ns->prefix_len, "_");
242 if (dsync_is_valid_name(ns, str_c(vname_str)))
248 str_append(vname_str, ns->prefix);
250 i_assert(dsync_is_valid_name(ns, str_c(vname_str)));
257 struct mail_namespace *ns;
264 ns = dsync_find_namespace(brain, name_parts);
265 if (ns == NULL)
267 ns_sep = mail_namespace_get_sep(ns);
282 dsync_fix_mailbox_name(ns, vname, brain->alt_char);
284 *ns_r = ns;
326 struct mail_namespace *ns;
334 if (dsync_get_mailbox_name(brain, parts, &name, &ns) < 0) {
347 node->ns = ns;
427 if (other_node->ns != node->ns && other_node->ns != NULL) {
436 other_node->ns = node->ns;