]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Track whether escape character was added just for dsync
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 1 Mar 2022 16:51:04 +0000 (11:51 -0500)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Mon, 21 Mar 2022 09:06:53 +0000 (10:06 +0100)
Will be used by the following commit

src/doveadm/doveadm-dsync.c
src/doveadm/dsync/dsync-brain.c
src/doveadm/dsync/dsync-brain.h

index 7d9faf8be56275d7fd30b6b06603442db2d64553..e490def451d40cb94e34690f0436d14058931bb0 100644 (file)
@@ -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;
                }
        }
 }
index 153d7597ba9220a469233f65122b201c3a5c7914..8ff7247630b175eb5ee8db391b875c2bbb88a136 100644 (file)
@@ -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 *
index 93b8e95ea9b7d6802fb1bf9771726f2a0f610d99..5813148cdae45f21fa531442fbeee114faa890bc 100644 (file)
@@ -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,