aboutsummaryrefslogtreecommitdiff
path: root/lib
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
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')
-rw-r--r--lib/message.cc4
-rw-r--r--lib/notmuch.h3
2 files changed, 7 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)) {
diff --git a/lib/notmuch.h b/lib/notmuch.h
index 98f6e91a..2c5dcab5 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -1764,6 +1764,9 @@ notmuch_message_destroy (notmuch_message_t *message);
* add or delete values for, as other subsystems or extensions may
* depend on these properties.
*
+ * Please see notmuch-properties(7) for more details about specific
+ * properties and conventions around their use.
+ *
*/
/**@{*/
/**