Re: [PATCH v3 10/15] crypto: index encrypted parts when indexopts try_decrypt is set.

Subject: Re: [PATCH v3 10/15] crypto: index encrypted parts when indexopts try_decrypt is set.

Date: Thu, 12 Oct 2017 22:08:26 -0300

To: Daniel Kahn Gillmor, Notmuch Mail

Cc:

From: David Bremner


Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:

> +	if (status) {
> +	    _notmuch_database_log (notmuch, "Warning: setup failed for decrypting "
> +				   "during indexing. (%d)\n", status);
> +	    status = notmuch_message_add_property (message, "index-decryption", "failure");
> +	    if (status)
> +		_notmuch_database_log (notmuch, "failed to add index-decryption "
> +				       "property (%d)\n", status);
> +	    return;
> +	}

The second _notmuch_database_log will override the first
here. You can use _notmuch_database_log_append if you don't want to
clear the existing log (e.g. at least for the second _log
here).

> +    const char *autoproperties[] = { "index-decryption" };

I'm always a bit nervous when I see the same string hard coded into two
different places.  What about using some prefix naming scheme like
"index.auto.decryption" with the idea that all properties with the
prefix "index.auto." could be blown away. If we settle on a prefix based
naming scheme now, we could do the minor tweak to the properties API
later so that it's only a single call.
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: