[PATCH 23/23] cli: wrap getting uid

Subject: [PATCH 23/23] cli: wrap getting uid

Date: Sat, 3 Jun 2017 14:47:54 -0300

To: notmuch@notmuchmail.org, notmuch@freelists.org

Cc:

From: David Bremner


Apparently it moved from "name" to "key_id" in gmime-3.0
---
 notmuch-show.c     | 2 +-
 util/gmime-extra.h | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/notmuch-show.c b/notmuch-show.c
index b1f58428..4407a8cb 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -453,7 +453,7 @@ format_part_sigstatus_sprinter (sprinter_t *sp, mime_node_t *node)
 	    /* note that gmime is using the term "trust" here, which
 	     * is WRONG.  It's actually user id "validity". */
 	    if (certificate) {
-		const char *name = g_mime_certificate_get_name (certificate);
+		const char *name = g_mime_certificate_get_uid (certificate);
 		GMimeCertificateTrust trust = g_mime_certificate_get_trust (certificate);
 		if (name && (trust == GMIME_CERTIFICATE_TRUST_FULLY || trust == GMIME_CERTIFICATE_TRUST_ULTIMATE)) {
 		    sp->map_key (sp, "userid");
diff --git a/util/gmime-extra.h b/util/gmime-extra.h
index 4407be33..cf8d9a2d 100644
--- a/util/gmime-extra.h
+++ b/util/gmime-extra.h
@@ -15,11 +15,12 @@ GMimeStream *g_mime_stream_stdout_new(void);
 
 #define g_mime_2_6_unref(obj) g_object_unref (obj)
 #define g_mime_certificate_get_fpr16(cert) g_mime_certificate_get_key_id (cert)
-
+#define g_mime_certificate_get_uid(cert) g_mime_certificate_get_name (cert);
 #else /* GMime >= 3.0 */
 typedef GMimeAddressType GMimeRecipientType;
 
 #define GMIME_ENABLE_RFC_2047_WORKAROUNDS 0xdeadbeef
+#define g_mime_certificate_get_uid(cert) g_mime_certificate_get_key_id (cert);
 #define g_mime_content_type_to_string(c) g_mime_content_type_get_mime_type (c)
 #define g_mime_filter_crlf_new(encode,dots) g_mime_filter_dos2unix_new (FALSE)
 #define g_mime_gpg_context_new(func,path) g_mime_gpg_context_new ()
-- 
2.11.0


Thread: