From: Timo Sirainen Date: Tue, 1 Mar 2022 16:51:04 +0000 (-0500) Subject: dsync: Track whether escape character was added just for dsync X-Git-Tag: 2.3.19~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cfd1b0687fa26676abcb1cae087bf321adda2c9b;p=thirdparty%2Fdovecot%2Fcore.git dsync: Track whether escape character was added just for dsync Will be used by the following commit --- diff --git a/src/doveadm/doveadm-dsync.c b/src/doveadm/doveadm-dsync.c index 7d9faf8be5..e490def451 100644 --- a/src/doveadm/doveadm-dsync.c +++ b/src/doveadm/doveadm-dsync.c @@ -334,11 +334,17 @@ static void doveadm_user_init_dsync(struct mail_user *user) user->dsyncing = TRUE; for (ns = user->namespaces; ns != NULL; ns = ns->next) { + struct dsync_mailbox_list *dlist = + p_new(ns->list->pool, struct dsync_mailbox_list, 1); + MODULE_CONTEXT_SET(ns->list, dsync_mailbox_list_module, dlist); + if (ns->list->set.vname_escape_char == '\0') { ns->list->set.vname_escape_char = ns_sep != DSYNC_LIST_VNAME_ESCAPE_CHAR ? DSYNC_LIST_VNAME_ESCAPE_CHAR : DSYNC_LIST_VNAME_ALT_ESCAPE_CHAR; + } else { + dlist->have_orig_escape_char = TRUE; } } } diff --git a/src/doveadm/dsync/dsync-brain.c b/src/doveadm/dsync/dsync-brain.c index 153d7597ba..8ff7247630 100644 --- a/src/doveadm/dsync/dsync-brain.c +++ b/src/doveadm/dsync/dsync-brain.c @@ -40,6 +40,9 @@ static const char *dsync_state_names[] = { "done" }; +struct dsync_mailbox_list_module dsync_mailbox_list_module = + MODULE_CONTEXT_INIT(&mailbox_list_module_register); + static void dsync_brain_mailbox_states_dump(struct dsync_brain *brain); static const char * diff --git a/src/doveadm/dsync/dsync-brain.h b/src/doveadm/dsync/dsync-brain.h index 93b8e95ea9..5813148cda 100644 --- a/src/doveadm/dsync/dsync-brain.h +++ b/src/doveadm/dsync/dsync-brain.h @@ -1,8 +1,10 @@ #ifndef DSYNC_BRAIN_H #define DSYNC_BRAIN_H +#include "module-context.h" #include "guid.h" #include "mail-error.h" +#include "mailbox-list-private.h" struct mail_namespace; struct mail_user; @@ -85,6 +87,15 @@ struct dsync_brain_settings { const char *state; }; +#define DSYNC_LIST_CONTEXT(obj) \ + MODULE_CONTEXT(obj, dsync_mailbox_list_module) +struct dsync_mailbox_list { + union mailbox_list_module_context module_ctx; + bool have_orig_escape_char; +}; +extern MODULE_CONTEXT_DEFINE(dsync_mailbox_list_module, + &mailbox_list_module_register); + struct dsync_brain * dsync_brain_master_init(struct mail_user *user, struct dsync_ibc *ibc, enum dsync_brain_sync_type sync_type,