summaryrefslogtreecommitdiff
path: root/lib/database.cc
diff options
context:
space:
mode:
authorCarl Worth <cworth@cworth.org>2010-01-06 10:06:00 -0800
committerCarl Worth <cworth@cworth.org>2010-01-06 10:32:06 -0800
commit4b418343f656c2de5503d907d075019626561373 (patch)
treefb5d30faffaf7161211c163d08f288e7a8fa055f /lib/database.cc
parent777cd23d9db64c8015fe880a106e84c3634bf19f (diff)
lib: Indicate whether notmuch_database_remove_message removed anything.
Similar to the return value of notmuch_database_add_message, we now enhance the return value of notmuch_database_remove_message to indicate whether the message document was entirely removed (SUCCESS) or whether only this filename was removed and the document exists under other filenamed (DUPLICATE_MESSAGE_ID).
Diffstat (limited to 'lib/database.cc')
-rw-r--r--lib/database.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/database.cc b/lib/database.cc
index 205d036..dc967c8 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -1201,14 +1201,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 *