From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 28F1B6DE13F8 for ; Thu, 2 May 2019 06:19:54 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.145 X-Spam-Level: X-Spam-Status: No, score=-0.145 tagged_above=-999 required=5 tests=[AWL=0.056, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4gyYnNg57YV0 for ; Thu, 2 May 2019 06:19:53 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id BDA5E6DE10A1 for ; Thu, 2 May 2019 06:19:51 -0700 (PDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1556803190; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=/HhmUjSii+RnGY7rGqkGqtshhyJ7UOE1Anq2H4nP0q4=; b=D5fmo/cF7ieTPBjBcFoNWEXXMUOQ6hquPVLIpAXZ0zHN41ZHkaCqRN7p /Q1QCt06QvQWv9XXnkj+hLxRLb4iBQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1556803190; h=from : to : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : from; bh=/HhmUjSii+RnGY7rGqkGqtshhyJ7UOE1Anq2H4nP0q4=; b=vUWSKlQ9QJ6yguQkRrB1oGKj95uUXnRc5rn3ByIQ0HtEYtnrHNrvmKjc IN21oW3+GnkFl0LcOrRqEv2gIqjZpJG9TLlOH93co7R9rb0fycV91WqqEw 6hu4I2i8P39twqkeRtDScLQUaHkjBMdxwlIFuDSvB1n4Pg8jN+TeoYEsAI S3jbtodg8S6jU+RR/ORMCiSMr0BUH24U7poLHH3t2aR2wMsnstW/qm71T7 dgFiQaSuY1wX0CsfM5qj61sJX30Iif+fd4ciaGbNNfaW0IIm4xEtAZxVEH ZcZ+OljTkLV6x8B+D+rvHJ5OX27LRZTPVRWxBgUT+a3ximADHeO1gA== Received: from fifthhorseman.net (ool-6c3a0662.static.optonline.net [108.58.6.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id 644F8F99E for ; Thu, 2 May 2019 09:19:50 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id CE32320D7D; Thu, 2 May 2019 09:19:47 -0400 (EDT) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH v2 11/15] gmime-cleanup: use GMime 3.0 data types Date: Thu, 2 May 2019 09:19:43 -0400 Message-Id: <20190502131947.16509-11-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190502131947.16509-1-dkg@fifthhorseman.net> References: <20190502051653.8502-1-dkg@fifthhorseman.net> <20190502131947.16509-1-dkg@fifthhorseman.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 May 2019 13:19:54 -0000 Signed-off-by: Daniel Kahn Gillmor --- notmuch-reply.c | 4 ++-- notmuch-show.c | 8 ++++---- util/gmime-extra.h | 11 +++-------- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index fa91c5de..48fdbc92 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -176,7 +176,7 @@ static unsigned int scan_address_list (InternetAddressList *list, notmuch_config_t *config, GMimeMessage *message, - GMimeRecipientType type, + GMimeAddressType type, const char **user_from) { InternetAddress *address; @@ -325,7 +325,7 @@ add_recipients_from_message (GMimeMessage *reply, { struct { InternetAddressList * (*get_header)(GMimeMessage *message); - GMimeRecipientType recipient_type; + GMimeAddressType recipient_type; } reply_to_map[] = { { get_sender, GMIME_ADDRESS_TYPE_TO }, { get_to, GMIME_ADDRESS_TYPE_TO }, diff --git a/notmuch-show.c b/notmuch-show.c index 730a91f8..dc587108 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -363,13 +363,13 @@ signature_status_to_string (GMimeSignatureStatus status) /* Print signature flags */ struct key_map_struct { - GMimeSignatureError bit; + GMimeSignatureStatus bit; const char * string; }; static void do_format_signature_errors (sprinter_t *sp, struct key_map_struct *key_map, - unsigned int array_map_len, GMimeSignatureError errors) { + unsigned int array_map_len, GMimeSignatureStatus errors) { sp->map_key (sp, "errors"); sp->begin_map (sp); @@ -386,7 +386,7 @@ do_format_signature_errors (sprinter_t *sp, struct key_map_struct *key_map, static void format_signature_errors (sprinter_t *sp, GMimeSignature *signature) { - GMimeSignatureError errors = g_mime_signature_get_errors (signature); + GMimeSignatureStatus errors = g_mime_signature_get_status (signature); if (!(errors & GMIME_SIGNATURE_STATUS_ERROR_MASK)) return; @@ -465,7 +465,7 @@ format_part_sigstatus_sprinter (sprinter_t *sp, GMimeSignatureList *siglist) } if (notmuch_format_version <= 3) { - GMimeSignatureError errors = g_mime_signature_get_errors (signature); + GMimeSignatureStatus errors = g_mime_signature_get_status (signature); if (g_mime_signature_status_error (errors)) { sp->map_key (sp, "errors"); sp->integer (sp, errors); diff --git a/util/gmime-extra.h b/util/gmime-extra.h index e646efee..a183952d 100644 --- a/util/gmime-extra.h +++ b/util/gmime-extra.h @@ -18,15 +18,10 @@ GMimeStream *g_mime_stream_stdout_new(void); #define g_mime_object_set_header(o,h,v) g_mime_object_set_header (o,h,v,NULL) #define g_mime_parser_construct_message(p) g_mime_parser_construct_message (p, g_mime_parser_options_get_default ()) #define g_mime_part_get_content_object(p) g_mime_part_get_content (p) -#define g_mime_signature_get_errors(sig) g_mime_signature_get_status (sig) #define g_mime_utils_header_decode_text(txt) g_mime_utils_header_decode_text (NULL, txt) #define internet_address_to_string(ia,encode) internet_address_to_string (ia,NULL,encode) #define internet_address_list_parse_string(str) internet_address_list_parse (NULL,str) -typedef GMimeAddressType GMimeRecipientType; - -typedef GMimeSignatureStatus GMimeSignatureError; - /** * Get last 16 hex digits of fingerprint ("keyid") */ @@ -35,9 +30,9 @@ const char *g_mime_certificate_get_fpr16 (GMimeCertificate *cert); * Return the contents of the appropriate address header as a string * Should be freed using g_free */ -char *g_mime_message_get_address_string (GMimeMessage *message, GMimeRecipientType type); +char *g_mime_message_get_address_string (GMimeMessage *message, GMimeAddressType type); -InternetAddressList * g_mime_message_get_addresses (GMimeMessage *message, GMimeRecipientType type); +InternetAddressList * g_mime_message_get_addresses (GMimeMessage *message, GMimeAddressType type); /** * return talloc allocated date string @@ -71,7 +66,7 @@ gboolean g_mime_signature_status_good (GMimeSignatureStatus status); gboolean g_mime_signature_status_bad (GMimeSignatureStatus status); -gboolean g_mime_signature_status_error (GMimeSignatureError status); +gboolean g_mime_signature_status_error (GMimeSignatureStatus status); gint64 g_mime_utils_header_decode_date_unix (const char *date); -- 2.20.1