X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fdatabase.cc;fp=lib%2Fdatabase.cc;h=6987e2f417ae5039294b078836c24f7779b01506;hp=d1e5f1af534b8fca594399add8a976a0f8f9bc1b;hb=a554690d6af0ac8cb55166a20efd0f449abde389;hpb=3f5809bf28becbddfed9ff33d6f1242346904c23 diff --git a/lib/database.cc b/lib/database.cc index d1e5f1af..6987e2f4 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -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; +}