]> 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)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Tue, 1 Aug 2017 10:40:43 +0000 (13:40 +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 12b7f4443b5b7c0b659ab30eb08736a069368e4b..25e5c672d46d1d815045f23973f7c2c6334af1e6 100644 (file)
@@ -783,6 +783,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 a205c1139dd64051814dc8cb0d2f25885371265c..0fb3c6b396c4f94c0a83db61f74f3672d3dc939c 100644 (file)
@@ -858,7 +858,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 2970399ec728ba27cb602cdecdf44fab60536eb9..177f6a40a3455288439b8d56d14708f11b24ad9d 100644 (file)
@@ -111,14 +111,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)