X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=lib%2Fdatabase.cc;h=6987e2f417ae5039294b078836c24f7779b01506;hb=afa45bd6b886838b760884a1870f274fc33b5f89;hp=c05d70d34842f1fd1f264cc61a45fbb6348b95ca;hpb=3f27cce71f9f154cb0c2134c32d41c31eb62a239;p=notmuch diff --git a/lib/database.cc b/lib/database.cc index c05d70d3..6987e2f4 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -1456,7 +1456,7 @@ notmuch_database_remove_message (notmuch_database_t *notmuch, if (status == NOTMUCH_STATUS_SUCCESS && message) { status = _notmuch_message_remove_filename (message, filename); if (status == NOTMUCH_STATUS_SUCCESS) - _notmuch_message_delete (message); + status = _notmuch_message_delete (message); else if (status == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) _notmuch_message_sync (message); @@ -1573,3 +1573,15 @@ notmuch_database_status_string (const notmuch_database_t *notmuch) { return notmuch->status_string; } + +bool +_notmuch_database_indexable_as_text (notmuch_database_t *notmuch, const char *mime_string) +{ + for (size_t i = 0; i < notmuch->index_as_text_length; i++) { + if (regexec (¬much->index_as_text[i], mime_string, 0, NULL, 0) == 0) { + return true; + } + } + + return false; +}