}
define USE_NOTMUCH
msg-checking "Checking for Notmuch API version 3..."
- if {[cctest -includes {notmuch.h} \
- -code {
- notmuch_database_open("/path",
- NOTMUCH_DATABASE_MODE_READ_ONLY,
- (notmuch_database_t**)NULL);
- }]} {
+ if {[cctest -includes {notmuch.h} -libs {-lnotmuch} -link 1 \
+ -code { notmuch_database_open(NULL, 0, NULL); }]} {
define NOTMUCH_API_3
msg-result "yes"
} else {
msg-result "no"
}
+ cc-check-function-in-lib notmuch_database_index_file notmuch
}
###############################################################################
return -1;
mutt_debug(2, "nm: rename: add '%s'\n", new);
+#ifdef HAVE_NOTMUCH_DATABASE_INDEX_FILE
+ st = notmuch_database_index_file(db, new, NULL, &msg);
+#else
st = notmuch_database_add_message(db, new, &msg);
+#endif
if ((st != NOTMUCH_STATUS_SUCCESS) && (st != NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID))
{
{
mutt_debug(2, "nm: rename dup %s -> %s\n", path, newpath);
notmuch_database_remove_message(db, path);
+#ifdef HAVE_NOTMUCH_DATABASE_INDEX_FILE
+ notmuch_database_index_file(db, newpath, NULL, NULL);
+#else
notmuch_database_add_message(db, newpath, NULL);
+#endif
}
}
notmuch_message_destroy(msg);
if (trans < 0)
goto done;
+#ifdef HAVE_NOTMUCH_DATABASE_INDEX_FILE
+ st = notmuch_database_index_file(db, path, NULL, &msg);
+#else
st = notmuch_database_add_message(db, path, &msg);
+#endif
if ((st != NOTMUCH_STATUS_SUCCESS) && (st != NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID))
{