summaryrefslogtreecommitdiffstats
path: root/notmuch-insert.c
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2017-08-17 19:14:25 -0400
committerDavid Bremner <david@tethera.net>2017-08-23 07:38:37 -0300
commitb10ce6bc23002d48916b1b2f375480e7540e3164 (patch)
tree2c403d73fd6373bb943d08aa8a2303afb73dff16 /notmuch-insert.c
parent09fa51303c6ba5adfd2431d87663523aa799288b (diff)
database: add n_d_index_file (deprecates n_d_add_message)
We need a way to pass parameters to the indexing functionality on the first index, not just on reindexing. The obvious place is in notmuch_database_add_message. But since modifying the argument list would break both API and ABI, we needed a new name. I considered notmuch_database_add_message_with_params(), but the functionality we're talking about doesn't always add a message. It tries to index a specific file, possibly adding a message, but possibly doing other things, like adding terms to an existing message, or failing to deal with message objects entirely (e.g. because the file didn't contain a message). So i chose the function name notmuch_database_index_file. I confess i'm a little concerned about confusing future notmuch developers with the new name, since we already have a private _notmuch_message_index_file function, and the two do rather different things. But i think the added clarity for people linking against the future libnotmuch and the capacity for using index parameters makes this a worthwhile tradeoff. (that said, if anyone has another name that they strongly prefer, i'd be happy to go with it) This changeset also adjusts the tests so that we test whether the new, preferred function returns bad values (since the deprecated function just calls the new one). We can keep the deprecated n_d_add_message function around as long as we like, but at the next place where we're forced to break API or ABI we can probably choose to drop the name relatively safely. NOTE: there is probably more cleanup to do in the ruby and go bindings to complete the deprecation directly. I don't know those languages well enough to attempt a fix; i don't know how to test them; and i don't know the culture around those languages about API additions or deprecations.
Diffstat (limited to 'notmuch-insert.c')
-rw-r--r--notmuch-insert.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/notmuch-insert.c b/notmuch-insert.c
index 2590e836..648bd944 100644
--- a/notmuch-insert.c
+++ b/notmuch-insert.c
@@ -384,7 +384,7 @@ add_file (notmuch_database_t *notmuch, const char *path, tag_op_list_t *tag_ops,
notmuch_message_t *message;
notmuch_status_t status;
- status = notmuch_database_add_message (notmuch, path, &message);
+ status = notmuch_database_index_file (notmuch, path, NULL, &message);
if (status == NOTMUCH_STATUS_SUCCESS) {
status = tag_op_list_apply (message, tag_ops, 0);
if (status) {