Skip to content

Commit

Permalink
lib-storage: Optimize INBOX notifications with mailbox_list_index_inc…
Browse files Browse the repository at this point in the history
…lude_inbox=yes

There's no need for special INBOX checks in that case, because INBOX is
tracked in the mailbox list index the same as any other mailbox.
  • Loading branch information
sirainen authored and cmouse committed Sep 7, 2017
1 parent 046edb8 commit 7b15614
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/lib-storage/list/mailbox-list-index-notify.c
Expand Up @@ -101,9 +101,14 @@ int mailbox_list_index_notify_init(struct mailbox_list *list,
inotify->subscriptions = mailbox_tree_dup(list->subscriptions);
}
inotify->list_log_path = i_strdup(ilist->index->log->filepath);
if ((list->ns->flags & NAMESPACE_FLAG_INBOX_ANY) != 0 &&
mailbox_list_get_path(list, "INBOX", MAILBOX_LIST_PATH_TYPE_INDEX,
&index_dir) > 0) {
if (list->mail_set->mailbox_list_index_include_inbox) {
/* INBOX can be handled also using mailbox list index */
} else if ((list->ns->flags & NAMESPACE_FLAG_INBOX_ANY) == 0) {
/* no INBOX in this namespace */
} else if (mailbox_list_get_path(list, "INBOX", MAILBOX_LIST_PATH_TYPE_INDEX,
&index_dir) <= 0) {
/* no indexes for INBOX? can't handle it */
} else {
/* FIXME: annoyingly hardcoded filename. */
inotify->inbox_log_path = i_strdup_printf(
"%s/"MAIL_INDEX_PREFIX".log", index_dir);
Expand Down

0 comments on commit 7b15614

Please sign in to comment.