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.
This commit is contained in:
Austin Clements 2012-02-19 19:26:29 -05:00 committed by David Bremner
parent 1f0ead385a
commit 99789e77f2

View file

@ -404,8 +404,10 @@ signer_status_to_string (GMimeSignerStatus x)
#ifdef GMIME_ATLEAST_26 #ifdef GMIME_ATLEAST_26
static void static void
format_part_sigstatus_json (GMimeSignatureList *siglist) format_part_sigstatus_json (mime_node_t *node)
{ {
GMimeSignatureList *siglist = node->sig_list;
printf ("["); printf ("[");
if (!siglist) { if (!siglist) {
@ -470,8 +472,10 @@ format_part_sigstatus_json (GMimeSignatureList *siglist)
} }
#else #else
static void static void
format_part_sigstatus_json (const GMimeSignatureValidity* validity) format_part_sigstatus_json (mime_node_t *node)
{ {
const GMimeSignatureValidity* validity = node->sig_validity;
printf ("["); printf ("[");
if (!validity) { if (!validity) {
@ -696,11 +700,7 @@ format_part_json (const void *ctx, mime_node_t *node, notmuch_bool_t first)
if (node->verify_attempted) { if (node->verify_attempted) {
printf (", \"sigstatus\": "); printf (", \"sigstatus\": ");
#ifdef GMIME_ATLEAST_26 format_part_sigstatus_json (node);
format_part_sigstatus_json (node->sig_list);
#else
format_part_sigstatus_json (node->sig_validity);
#endif
} }
printf (", \"content-type\": %s", printf (", \"content-type\": %s",