From ef9a070c10dffc346b7dee0c7714d7bda7663017 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 30 Jun 2016 15:13:10 +0200 Subject: Properly track changes applied by preprocessors This is necessary so we get the actual changeset during replay, so a mark-as-read action doesn't result in a new mime message, but only the flag change. --- common/pipeline.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common/pipeline.cpp') diff --git a/common/pipeline.cpp b/common/pipeline.cpp index 976a83f..c6d5297 100644 --- a/common/pipeline.cpp +++ b/common/pipeline.cpp @@ -305,7 +305,7 @@ KAsync::Job Pipeline::modifiedEntity(void const *command, size_t size) // Apply diff // FIXME only apply the properties that are available in the buffer - Trace() << "Applying changed properties: " << diff->availableProperties(); + Trace() << "Applying changed properties: " << changeset; for (const auto &property : changeset) { const auto value = diff->getProperty(property); if (value.isValid()) { @@ -320,6 +320,7 @@ KAsync::Job Pipeline::modifiedEntity(void const *command, size_t size) } } + newAdaptor->resetChangedProperties(); for (auto processor : d->processors[bufferType]) { processor->modifiedEntity(key, Storage::maxRevision(d->transaction) + 1, *current, *newAdaptor, d->transaction); } @@ -330,7 +331,7 @@ KAsync::Job Pipeline::modifiedEntity(void const *command, size_t size) flatbuffers::FlatBufferBuilder metadataFbb; { //We add availableProperties to account for the properties that have been changed by the preprocessors - auto modifiedProperties = BufferUtils::toVector(metadataFbb, changeset + newAdaptor->availableProperties()); + auto modifiedProperties = BufferUtils::toVector(metadataFbb, changeset + newAdaptor->changedProperties()); auto metadataBuilder = MetadataBuilder(metadataFbb); metadataBuilder.add_revision(newRevision); metadataBuilder.add_operation(Operation_Modification); -- cgit v1.2.3