gmime-cleanup: use GMime 3.0 data types

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
This commit is contained in:
Daniel Kahn Gillmor 2019-05-02 09:19:43 -04:00 committed by David Bremner
parent 58ee5d1bb5
commit 38240aafac
3 changed files with 9 additions and 14 deletions

View file

@ -176,7 +176,7 @@ static unsigned int
scan_address_list (InternetAddressList *list, scan_address_list (InternetAddressList *list,
notmuch_config_t *config, notmuch_config_t *config,
GMimeMessage *message, GMimeMessage *message,
GMimeRecipientType type, GMimeAddressType type,
const char **user_from) const char **user_from)
{ {
InternetAddress *address; InternetAddress *address;
@ -325,7 +325,7 @@ add_recipients_from_message (GMimeMessage *reply,
{ {
struct { struct {
InternetAddressList * (*get_header)(GMimeMessage *message); InternetAddressList * (*get_header)(GMimeMessage *message);
GMimeRecipientType recipient_type; GMimeAddressType recipient_type;
} reply_to_map[] = { } reply_to_map[] = {
{ get_sender, GMIME_ADDRESS_TYPE_TO }, { get_sender, GMIME_ADDRESS_TYPE_TO },
{ get_to, GMIME_ADDRESS_TYPE_TO }, { get_to, GMIME_ADDRESS_TYPE_TO },

View file

@ -363,13 +363,13 @@ signature_status_to_string (GMimeSignatureStatus status)
/* Print signature flags */ /* Print signature flags */
struct key_map_struct { struct key_map_struct {
GMimeSignatureError bit; GMimeSignatureStatus bit;
const char * string; const char * string;
}; };
static void static void
do_format_signature_errors (sprinter_t *sp, struct key_map_struct *key_map, 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->map_key (sp, "errors");
sp->begin_map (sp); sp->begin_map (sp);
@ -386,7 +386,7 @@ do_format_signature_errors (sprinter_t *sp, struct key_map_struct *key_map,
static void static void
format_signature_errors (sprinter_t *sp, GMimeSignature *signature) 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)) if (!(errors & GMIME_SIGNATURE_STATUS_ERROR_MASK))
return; return;
@ -465,7 +465,7 @@ format_part_sigstatus_sprinter (sprinter_t *sp, GMimeSignatureList *siglist)
} }
if (notmuch_format_version <= 3) { 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)) { if (g_mime_signature_status_error (errors)) {
sp->map_key (sp, "errors"); sp->map_key (sp, "errors");
sp->integer (sp, errors); sp->integer (sp, errors);

View file

@ -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_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_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_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 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_to_string(ia,encode) internet_address_to_string (ia,NULL,encode)
#define internet_address_list_parse_string(str) internet_address_list_parse (NULL,str) #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") * 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 * Return the contents of the appropriate address header as a string
* Should be freed using g_free * 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 * 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_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); gint64 g_mime_utils_header_decode_date_unix (const char *date);