From 8f9e16f2b9a46bef2c7398a27ff29db7bb23ee8d Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 1 Sep 2024 11:41:40 -0400 Subject: [PATCH] lib: move call to _n_m_invalidate_metadata It is wrong most of the time in _notmuch_message_remove_terms, but that function is too low level to know how to call _n_m_invalidate_metadata with the right argument, at least not without more extensive changes. This change merely makes the current behaviour more obvious, since the other calls cannot have relied on metadata being invalidated. --- lib/message-property.cc | 1 + lib/message.cc | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/message-property.cc b/lib/message-property.cc index f876e5ef..588762c0 100644 --- a/lib/message-property.cc +++ b/lib/message-property.cc @@ -151,6 +151,7 @@ _notmuch_message_remove_all_properties (notmuch_message_t *message, const char * try { /* XXX better error reporting ? */ _notmuch_message_remove_terms (message, term_prefix); + _notmuch_message_invalidate_metadata (message, "property"); } catch (Xapian::Error &error) { LOG_XAPIAN_EXCEPTION (message, error); return _notmuch_xapian_error (); diff --git a/lib/message.cc b/lib/message.cc index 71723d2b..8b1fa400 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -723,8 +723,6 @@ _notmuch_message_remove_terms (notmuch_message_t *message, const char *prefix) /* Ignore failure to remove non-existent term. */ } } - - _notmuch_message_invalidate_metadata (message, "property"); } -- 2.45.2