- try {
- message->doc.remove_term ((*i));
- message->modified = true;
- } catch (const Xapian::InvalidArgumentError) {
- /* Ignore failure to remove non-existent term. */
- } catch (const Xapian::Error &error) {
- notmuch_database_t *notmuch = message->notmuch;
-
- if (!notmuch->exception_reported) {
- _notmuch_database_log(notmuch_message_get_database (message), "A Xapian exception occurred creating message: %s\n",
- error.get_msg().c_str());
- notmuch->exception_reported = true;
- }
- return NOTMUCH_PRIVATE_STATUS_XAPIAN_EXCEPTION;
+ if (strcmp (tag, "encrypted") != 0 &&
+ strcmp (tag, "signed") != 0 &&
+ strcmp (tag, "attachment") != 0) {
+ std::string term = tag_prefix + tag;
+ message->doc.add_term (term);