strncmp ((*j).c_str (), prefix, strlen (prefix)))
{
db->delete_document (document.get_docid ());
+ status = NOTMUCH_STATUS_SUCCESS;
} else {
db->replace_document (document.get_docid (), document);
+ status = NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID;
}
}
talloc_free (local);
- return NOTMUCH_STATUS_SUCCESS;
+ return status;
}
notmuch_tags_t *
/* Remove a message from the given notmuch database.
*
- * Note that the only this particular filename association is removed
- * from the database. If the same message (as determined by the
- * message ID) is still available via other filenames, then the
- * message will persist in the database for those filenames. When the
- * last filename is removed for a particular message, the database
- * content for that message will be entirely removed.
+ * Note that only this particular filename association is removed from
+ * the database. If the same message (as determined by the message ID)
+ * is still available via other filenames, then the message will
+ * persist in the database for those filenames. When the last filename
+ * is removed for a particular message, the database content for that
+ * message will be entirely removed.
+ *
+ * Return value:
+ *
+ * NOTMUCH_STATUS_SUCCESS: The last filename was removed and the
+ * message was removed from the database.
+ *
+ * NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID: This filename was removed but
+ * the message persists in the database with at least one other
+ * filename.
*/
notmuch_status_t
notmuch_database_remove_message (notmuch_database_t *database,