aboutsummaryrefslogtreecommitdiff
path: root/lib/message.cc
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2017-10-20 22:25:40 -0400
committerDavid Bremner <david@tethera.net>2017-10-21 19:53:08 -0300
commit0bb05ff693737c5b91d6a64f6209984a6c418c46 (patch)
tree9d60840a70576b3f5f71decd0128205b5e79e62f /lib/message.cc
parent6575b7eb31a710c8215be698d5cf31be20d4356e (diff)
reindex: drop all properties named with prefix "index."
This allows us to create new properties that will be automatically set during indexing, and cleared during re-indexing, just by choice of property name.
Diffstat (limited to 'lib/message.cc')
-rw-r--r--lib/message.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/message.cc b/lib/message.cc
index 4ab0ed26..e819f27a 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -1999,6 +1999,10 @@ notmuch_message_reindex (notmuch_message_t *message,
goto DONE;
}
+ ret = notmuch_message_remove_all_properties_with_prefix (message, "index.");
+ if (ret)
+ goto DONE; /* XXX TODO: distinguish from other error returns above? */
+
/* re-add the filenames with the associated indexopts */
for (; notmuch_filenames_valid (orig_filenames);
notmuch_filenames_move_to_next (orig_filenames)) {