str_append_c(ctx->path,
mailbox_list_get_hierarchy_sep(ctx->ctx.list));
}
- str_append(ctx->path, node->name);
+ str_append(ctx->path, node->raw_name);
ctx->info.vname = mailbox_list_get_vname(ctx->ctx.list, str_c(ctx->path));
ctx->info.flags = node->children != NULL ?
struct mailbox_list_index_node *node = ctx->next_node;
if (!ctx->prefix_inbox_list && ctx->ctx.list->ns->prefix_len > 0 &&
- strcmp(node->name, "INBOX") == 0 && node->parent == NULL &&
+ strcmp(node->raw_name, "INBOX") == 0 && node->parent == NULL &&
node->children != NULL) {
/* prefix/INBOX has children */
ctx->prefix_inbox_list = TRUE;
while (node->next == NULL) {
node = node->parent;
if (node != NULL) {
- ctx->parent_len -= strlen(node->name);
+ ctx->parent_len -= strlen(node->raw_name);
if (node->parent != NULL)
ctx->parent_len--;
}
const char *name)
{
while (node != NULL) {
- if (strcmp(node->name, name) == 0)
+ if (strcmp(node->raw_name, name) == 0)
return node;
node = node->next;
}
mailbox_list_index_node_get_path(node->parent, sep, str);
str_append_c(str, sep);
}
- str_append(str, node->name);
+ str_append(str, node->raw_name);
}
void mailbox_list_index_node_unlink(struct mailbox_list_index *ilist,
guid_128_generate(guid);
name = p_strdup_printf(ilist->mailbox_pool, "%s%s", prefix,
guid_128_to_string(guid));
- node->name = name;
+ node->raw_name = name;
node->flags |= MAILBOX_LIST_INDEX_FLAG_CORRUPTED_NAME;
hash_table_insert(ilist->mailbox_names,
const struct mailbox_list_index_node *n2)
{
return n1->parent == n2->parent &&
- strcmp(n1->name, n2->name) == 0 ? 0 : -1;
+ strcmp(n1->raw_name, n2->raw_name) == 0 ? 0 : -1;
}
static unsigned int
mailbox_list_index_node_hash(const struct mailbox_list_index_node *node)
{
- return str_hash(node->name) ^
+ return str_hash(node->raw_name) ^
POINTER_CAST_TO(node->parent, unsigned int);
}
node->name_id = ++ilist->highest_name_id;
node->corrupted_ext = TRUE;
}
- node->name = hash_table_lookup(ilist->mailbox_names,
+ node->raw_name = hash_table_lookup(ilist->mailbox_names,
POINTER_CAST(irec->name_id));
- if (node->name == NULL) {
+ if (node->raw_name == NULL) {
*error_r = t_strdup_printf(
"name_id=%u not in index header", irec->name_id);
if (ilist->has_backing_store)
node->flags |= MAILBOX_LIST_INDEX_FLAG_NOSELECT;
*error_r = t_strdup_printf(
"mailbox '%s' (uid=%u) is missing GUID - "
- "marking it non-selectable", node->name, node->uid);
+ "marking it non-selectable", node->raw_name, node->uid);
node->corrupted_flags = TRUE;
}
if (!ilist->has_backing_store && !guid_128_is_empty(irec->guid) &&
node->flags &= ENUM_NEGATE(MAILBOX_LIST_INDEX_FLAG_NONEXISTENT | MAILBOX_LIST_INDEX_FLAG_NOSELECT);
*error_r = t_strdup_printf(
"non-selectable mailbox '%s' (uid=%u) already has GUID - "
- "marking it selectable", node->name, node->uid);
+ "marking it selectable", node->raw_name, node->uid);
node->corrupted_flags = TRUE;
}
} else if (node_has_parent(parent, node)) {
*error_r = t_strdup_printf(
"parent_uid=%u loops to node itself (%s)",
- uid, node->name);
+ uid, node->raw_name);
if (ilist->has_backing_store)
break;
/* just place it under the root */
parent->children = node;
continue;
}
- } else if (strcasecmp(node->name, "INBOX") == 0) {
+ } else if (strcasecmp(node->raw_name, "INBOX") == 0) {
ilist->rebuild_on_missing_inbox = FALSE;
}
if (hash_table_lookup(duplicate_hash, node) == NULL)
hash_table_insert(duplicate_hash, node, node);
else {
- const char *old_name = node->name;
+ const char *old_name = node->raw_name;
if (ilist->has_backing_store) {
*error_r = t_strdup_printf(
"Duplicate mailbox '%s' in index",
- node->name);
+ node->raw_name);
break;
}
node->corrupted_ext = TRUE;
node->name_id = ++ilist->highest_name_id;
mailbox_list_index_generate_name(ilist, node,
- t_strconcat(node->name, "-duplicate-", NULL));
+ t_strconcat(node->raw_name, "-duplicate-", NULL));
*error_r = t_strdup_printf(
"Duplicate mailbox '%s' in index, renaming to %s",
- old_name, node->name);
+ old_name, node->raw_name);
}
node->next = ilist->mailbox_tree;
ilist->mailbox_tree = node;