aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKevin Boulain <kevin@boula.in>2023-03-29 18:13:32 +0200
committerDavid Bremner <david@tethera.net>2023-03-30 08:01:09 -0300
commitfb55ff28a2fdaa9c218af5ca10b1cae674869edd (patch)
treef746c06e300eceb71fa3a02d9a7b20f41007a563 /lib
parent336334996750240608d5f29ed5dd8e40a69c4d79 (diff)
lib/message-property: sync removed properties to the database
_notmuch_message_remove_all_properties wasn't syncing the message back to the database but was still invalidating the metadata, giving the impression the properties had actually been removed. Also move the metadata invalidation to _notmuch_message_remove_terms to be closer to what's done in _notmuch_message_modify_property and _notmuch_message_remove_term.
Diffstat (limited to 'lib')
-rw-r--r--lib/message-property.cc4
-rw-r--r--lib/message.cc2
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/message-property.cc b/lib/message-property.cc
index 0d444bb8..7f520340 100644
--- a/lib/message-property.cc
+++ b/lib/message-property.cc
@@ -142,7 +142,6 @@ _notmuch_message_remove_all_properties (notmuch_message_t *message, const char *
if (status)
return status;
- _notmuch_message_invalidate_metadata (message, "property");
if (key)
term_prefix = talloc_asprintf (message, "%s%s%s", _find_prefix ("property"), key,
prefix ? "" : "=");
@@ -157,6 +156,9 @@ _notmuch_message_remove_all_properties (notmuch_message_t *message, const char *
return NOTMUCH_STATUS_XAPIAN_EXCEPTION;
}
+ if (! _notmuch_message_frozen (message))
+ _notmuch_message_sync (message);
+
return NOTMUCH_STATUS_SUCCESS;
}
diff --git a/lib/message.cc b/lib/message.cc
index 1b1a071a..53f35dd1 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -719,6 +719,8 @@ _notmuch_message_remove_terms (notmuch_message_t *message, const char *prefix)
/* Ignore failure to remove non-existent term. */
}
}
+
+ _notmuch_message_invalidate_metadata (message, "property");
}