Skip to content

Commit

Permalink
lib-storage: Make mailbox_is_autocreated() public
Browse files Browse the repository at this point in the history
This also removes duplicated code from acl plugin.
  • Loading branch information
sirainen authored and GitLab committed Jun 28, 2017
1 parent 50bf6cf commit b0f0854
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/lib-storage/mail-storage-private.h
Expand Up @@ -774,6 +774,8 @@ int mailbox_mkdir(struct mailbox *box, const char *path,
Optimized for case where the directory usually exists. */
int mailbox_create_missing_dir(struct mailbox *box,
enum mailbox_list_path_type type);
/* Returns TRUE if mailbox is autocreated. */
bool mailbox_is_autocreated(struct mailbox *box);

/* Returns -1 if error, 0 if failed with EEXIST, 1 if ok */
int mailbox_create_fd(struct mailbox *box, const char *path, int flags,
Expand Down
2 changes: 1 addition & 1 deletion src/lib-storage/mail-storage.c
Expand Up @@ -836,7 +836,7 @@ void mailbox_set_reason(struct mailbox *box, const char *reason)
box->reason = p_strdup(box->pool, reason);
}

static bool mailbox_is_autocreated(struct mailbox *box)
bool mailbox_is_autocreated(struct mailbox *box)
{
if (box->inbox_user)
return TRUE;
Expand Down
8 changes: 0 additions & 8 deletions src/plugins/acl/acl-mailbox.c
Expand Up @@ -112,14 +112,6 @@ static void acl_mailbox_copy_acls_from_parent(struct mailbox *box)
acl_object_deinit(&parent_aclobj);
}

static bool mailbox_is_autocreated(struct mailbox *box)
{
if (box->inbox_user)
return TRUE;
return box->set != NULL &&
strcmp(box->set->autocreate, MAILBOX_SET_AUTO_NO) != 0;
}

static int
acl_mailbox_create(struct mailbox *box, const struct mailbox_update *update,
bool directory)
Expand Down

0 comments on commit b0f0854

Please sign in to comment.