dovecot-2.2: dsync: Set last_change timestamp for unset attributes.

dovecot at dovecot.org dovecot at dovecot.org
Tue Mar 19 14:00:59 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/3e4c4f9c230b
changeset: 16046:3e4c4f9c230b
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Mar 19 13:59:22 2013 +0200
description:
dsync: Set last_change timestamp for unset attributes.

diffstat:

 src/doveadm/dsync/dsync-mailbox-import.c |  17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diffs (35 lines):

diff -r cdfc9f30b482 -r 3e4c4f9c230b src/doveadm/dsync/dsync-mailbox-import.c
--- a/src/doveadm/dsync/dsync-mailbox-import.c	Tue Mar 19 13:59:02 2013 +0200
+++ b/src/doveadm/dsync/dsync-mailbox-import.c	Tue Mar 19 13:59:22 2013 +0200
@@ -247,6 +247,7 @@
 				   const struct dsync_mailbox_attribute *attr)
 {
 	const struct dsync_mailbox_attribute *local_attr;
+	struct mail_attribute_value value;
 	int ret;
 
 	i_assert(attr->value != NULL || attr->deleted);
@@ -298,18 +299,12 @@
 				return 0;
 		}
 	}
-	if (attr->value != NULL) {
-		struct mail_attribute_value value;
 
-		memset(&value, 0, sizeof(value));
-		value.value = attr->value;
-		value.last_change = attr->last_change;
-		ret = mailbox_attribute_set(importer->trans, attr->type,
-					    attr->key, &value);
-	} else {
-		ret = mailbox_attribute_unset(importer->trans, attr->type,
-					      attr->key);
-	}
+	memset(&value, 0, sizeof(value));
+	value.value = attr->value;
+	value.last_change = attr->last_change;
+	ret = mailbox_attribute_set(importer->trans, attr->type,
+				    attr->key, &value);
 	if (ret < 0) {
 		i_error("Mailbox %s: Failed to set attribute %s: %s",
 			mailbox_get_vname(importer->box), attr->key,


More information about the dovecot-cvs mailing list