bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch/* Copyright (c) 2013-2018 Dovecot authors, see the included COPYING file */
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainenmailbox_list_notify_node_get_status(struct mailbox_list_notify_tree *tree,
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen if (!mail_index_lookup_seq(tree->view, nnode->index_uid, &seq))
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen (void)mailbox_list_index_status(tree->list, tree->view, seq,
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen STATUS_UIDVALIDITY | STATUS_UIDNEXT | STATUS_MESSAGES |
e048e63fec8d21d4af0fd9d27dd3fe5dcedf18e6Timo Sirainen STATUS_UNSEEN | STATUS_HIGHESTMODSEQ, &status, nnode->guid, NULL);
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen nnode->highest_modseq = status.highest_modseq;
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainenmailbox_list_notify_node_build(struct mailbox_list_notify_tree *tree,
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen node = mailbox_tree_get(tree->mailboxes, str_c(path), &created);
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen if ((index_node->flags & MAILBOX_LIST_INDEX_FLAG_NONEXISTENT) != 0)
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen else if ((index_node->flags & MAILBOX_LIST_INDEX_FLAG_NOSELECT) != 0)
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen mailbox_list_notify_node_get_status(tree, nnode);
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen if ((index_node->flags & MAILBOX_LIST_INDEX_FLAG_NOINFERIORS) != 0)
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen str_append_c(path, mailbox_list_get_hierarchy_sep(tree->list));
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen for (; index_node != NULL; index_node = index_node->next) {
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen mailbox_list_notify_node_build(tree, index_node, path);
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainenmailbox_list_notify_tree_build(struct mailbox_list_notify_tree *tree)
43ce61b1d755832186f12b9739d18212b4744d14Aki Tuomi struct mailbox_list_index *ilist = INDEX_LIST_CONTEXT_REQUIRE(tree->list);
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen if (mailbox_list_index_refresh(tree->list) < 0)
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen tree->view = mail_index_view_open(ilist->index);
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen for (; index_node != NULL; index_node = index_node->next) {
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen mailbox_list_notify_node_build(tree, index_node, path);
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainenmailbox_list_notify_tree_init(struct mailbox_list *list)
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen tree = i_new(struct mailbox_list_notify_tree, 1);
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen mailbox_tree_init_size(mailbox_list_get_hierarchy_sep(list),
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen sizeof(struct mailbox_notify_node));
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainenvoid mailbox_list_notify_tree_deinit(struct mailbox_list_notify_tree **_tree)
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainen struct mailbox_list_notify_tree *tree = *_tree;
8854395cdd21ca521b37ce669f3acb8445792b20Timo Sirainenmailbox_list_notify_tree_lookup(struct mailbox_list_notify_tree *tree,