]> git.cworth.org Git - notmuch/blobdiff - lib/message.cc
emacs: Add new option notmuch-search-hide-excluded
[notmuch] / lib / message.cc
index 1b1a071aa56e408597fd857787ecce742874f3ad..46638f800997d4c5250b3592e4be8ee79abc2a21 100644 (file)
@@ -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");
 }
 
 
@@ -1395,14 +1397,15 @@ _notmuch_message_delete (notmuch_message_t *message)
        Xapian::PostingIterator thread_doc, thread_doc_end;
        Xapian::PostingIterator mail_doc, mail_doc_end;
 
-       message->notmuch->writable_xapian_db->delete_document (message->doc_id);
-
        /* look for a non-ghost message in the same thread */
        /* if this was a ghost to begin with, we are done */
        private_status = _notmuch_message_has_term (message, "type", "ghost", &is_ghost);
        if (private_status)
            return COERCE_STATUS (private_status,
                                  "Error trying to determine whether message was a ghost");
+
+       message->notmuch->writable_xapian_db->delete_document (message->doc_id);
+
        if (is_ghost)
            return NOTMUCH_STATUS_SUCCESS;