[PATCH 07/20] cli/show: emit new whole-message crypto status output

Daniel Kahn Gillmor dkg at fifthhorseman.net
Fri Jun 29 08:41:25 PDT 2018


On Fri 2018-06-15 20:47:59 -0300, David Bremner wrote:
> Daniel Kahn Gillmor <dkg at fifthhorseman.net> writes:
>
>> +
>> +	const _notmuch_message_crypto_t *msg_crypto = mime_node_get_message_crypto_status (node);
>> +	if (msg_crypto->sig_list ||
>> +	    msg_crypto->decryption_status != NOTMUCH_MESSAGE_DECRYPTED_NONE) {
>> +	    sp->map_key (sp, "crypto");
>
> I believe the new stuff needs to guarded by
>
> if (notmuch_format_version >= 5)

hm, maybe it can all still be v4?  over in notmuch-client.h, it says:

    /* The current structured output format version.  Requests for format
     * versions above this will return an error.  Backwards-incompatible
     * changes such as removing map fields, changing the meaning of map
     * fields, or changing the meanings of list elements should increase
     * this.  New (required) map fields can be added without increasing
     * this.
     */
    #define NOTMUCH_FORMAT_CUR 4

i don't know exactly what "map fields" means here -- i don't think of
notmuch-show output as a "map" but maybe i'm using the terminology
wrong.

and, despite the comments above, the versioning actually looks like
this:

    Version history
    ---------------

    v1
    - First versioned schema release.
    - Added part.content-length and part.content-transfer-encoding fields.

    v2
    - Added the thread_summary.query field.

    v3
    - Replaced message.filename string with a list of filenames.
    - Added part.content-disposition field.

    v4
    - replace signature error integer bitmask with a set of flags for
      individual errors.


So we have bumped from 1 to 2 with just a simple addition in the past.
But maybe that was from before we knew better?

At any rate, since the only thing that we're doing is emitting
message.crypto, i think we can avoid bumping the version in this series.

That said, i think i need to wrap the block with a test for
(notmuch_format_version >= 4) in this case, right?

My new series will try out something like this, let me know what you
think!

          --dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20180629/5daa2dc2/attachment.sig>


More information about the notmuch mailing list