]> git.cworth.org Git - notmuch/blobdiff - lib/message-property.cc
lib/message-property: sync removed properties to the database
[notmuch] / lib / message-property.cc
index 0d444bb804ab5a3f0064abcc0606b51ec81e0daa..7f5203403723d3514e8d85f738d43b546adcabe7 100644 (file)
@@ -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;
 }