]> git.notmuchmail.org Git - notmuch/blobdiff - lib/database.cc
lib: Clarify internal documentation of _notmuch_database_filename_to_direntry
[notmuch] / lib / database.cc
index 205d0360e1c2f07c79cb29b28b82a442b40f2384..125b37ebb6b5538d4d4d07cf2d6c3eaef2df7ee2 100644 (file)
@@ -723,6 +723,9 @@ _notmuch_database_get_directory_path (void *ctx,
  * database path or absolute with initial components identical to
  * database path), return a new string (with 'ctx' as the talloc
  * owner) suitable for use as a direntry term value.
+ *
+ * The necessary directory documents will be created in the database
+ * as needed.
  */
 notmuch_status_t
 _notmuch_database_filename_to_direntry (void *ctx,
@@ -1201,14 +1204,16 @@ notmuch_database_remove_message (notmuch_database_t *notmuch,
            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 *