From df97180092ae581323dc96c7795c737721e966a0 Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Thu, 14 Sep 2017 01:46:12 +0200 Subject: [PATCH] lib-storage: Implemented new mailbox flag MAILBOX_FLAG_AUTO_SUBSCRIBE. When this flag is enabled, the mailbox is implicitly subscribed to when it is created automatically. --- src/lib-storage/mail-storage.c | 2 ++ src/lib-storage/mail-storage.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index 02beaa6e45..e472b3efc9 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -888,6 +888,8 @@ bool mailbox_is_autocreated(struct mailbox *box) bool mailbox_is_autosubscribed(struct mailbox *box) { + if ((box->flags & MAILBOX_FLAG_AUTO_SUBSCRIBE) != 0) + return TRUE; return box->set != NULL && strcmp(box->set->autocreate, MAILBOX_SET_AUTO_SUBSCRIBE) == 0; } diff --git a/src/lib-storage/mail-storage.h b/src/lib-storage/mail-storage.h index 830dbe5f19..9b9a967185 100644 --- a/src/lib-storage/mail-storage.h +++ b/src/lib-storage/mail-storage.h @@ -63,6 +63,8 @@ enum mailbox_flags { MAILBOX_FLAG_USE_STUBS = 0x800, /* Mailbox is created implicitly if it does not exist. */ MAILBOX_FLAG_AUTO_CREATE = 0x1000, + /* Mailbox is subscribed to implicitly when it is created automatically */ + MAILBOX_FLAG_AUTO_SUBSCRIBE = 0x2000 }; enum mailbox_feature { -- 2.47.3