]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Make mailbox_is_autocreated() public
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 27 Jun 2017 11:22:50 +0000 (14:22 +0300)
committerGitLab <gitlab@git.dovecot.net>
Wed, 28 Jun 2017 14:57:07 +0000 (17:57 +0300)
This also removes duplicated code from acl plugin.

src/lib-storage/mail-storage-private.h
src/lib-storage/mail-storage.c
src/plugins/acl/acl-mailbox.c

index 8dd9e11f7e686915e7e8435c8e39f554f7d2814e..3eea8feec2f9c1c84835ae8b39c30e4a588694d0 100644 (file)
@@ -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,
index 2405161e0531aae632b79a1db574a65e7fef26f3..fb5b6aa003ceed532a1e4fe419b047f0ada47cae 100644 (file)
@@ -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;
index aa0c1751fb05286a2b3d64d3ede202eabb3bd24e..4efcc0f10399d7433654e241b6576913a2adf582 100644 (file)
@@ -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)