diff options
| author | David Bremner <david@tethera.net> | 2023-09-18 06:16:47 -0300 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2023-09-18 06:16:47 -0300 |
| commit | 1129cf890ef812321ac8296a4ca964a796df0b87 (patch) | |
| tree | ffe0b3a98a7210c292d94d3ae6c9ebbed70fd4a5 /lib/database.cc | |
| parent | 12aa05f07cb8aae736895c46fb25e0106daf207c (diff) | |
| parent | d4e0aaa76bd9e7a9e36abf47dc9ad3ea8bc10334 (diff) | |
Merge remote-tracking branch 'origin/master' into nmwebnmweb
Diffstat (limited to 'lib/database.cc')
| -rw-r--r-- | lib/database.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/database.cc b/lib/database.cc index c05d70d3..737a3f30 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -1454,9 +1454,11 @@ notmuch_database_remove_message (notmuch_database_t *notmuch, &message); if (status == NOTMUCH_STATUS_SUCCESS && message) { - status = _notmuch_message_remove_filename (message, filename); + if (notmuch_message_count_files (message) > 1) { + 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 +1575,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; +} |
