From 99789e77f2a18fd89198fd9cebdb7a756dd367e3 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sun, 19 Feb 2012 19:26:29 -0500 Subject: [PATCH] show: Make format_part_sigstatus_json's API consistent between GMIME 2.4 and 2.6 The implementation is still different for GMIME 2.4 and 2.6, but at least now the caller doesn't have to be aware of this. --- notmuch-show.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/notmuch-show.c b/notmuch-show.c index 8fb6fa67..07276c7d 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -404,8 +404,10 @@ signer_status_to_string (GMimeSignerStatus x) #ifdef GMIME_ATLEAST_26 static void -format_part_sigstatus_json (GMimeSignatureList *siglist) +format_part_sigstatus_json (mime_node_t *node) { + GMimeSignatureList *siglist = node->sig_list; + printf ("["); if (!siglist) { @@ -470,8 +472,10 @@ format_part_sigstatus_json (GMimeSignatureList *siglist) } #else static void -format_part_sigstatus_json (const GMimeSignatureValidity* validity) +format_part_sigstatus_json (mime_node_t *node) { + const GMimeSignatureValidity* validity = node->sig_validity; + printf ("["); if (!validity) { @@ -696,11 +700,7 @@ format_part_json (const void *ctx, mime_node_t *node, notmuch_bool_t first) if (node->verify_attempted) { printf (", \"sigstatus\": "); -#ifdef GMIME_ATLEAST_26 - format_part_sigstatus_json (node->sig_list); -#else - format_part_sigstatus_json (node->sig_validity); -#endif + format_part_sigstatus_json (node); } printf (", \"content-type\": %s", -- 2.26.2