X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=notmuch-show.c;h=65167c2f7851b0aab3fb811be1294b65bbaf4e21;hb=852167479f552cd396b1fdcbe9b1cb4db40e5e0a;hp=4ed5ff2b7dc54c2f2791a8685ea207b7ae166ba3;hpb=570349e132da5e19b36a004e633b870cec810170;p=notmuch diff --git a/notmuch-show.c b/notmuch-show.c index 4ed5ff2b..65167c2f 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -146,7 +146,7 @@ _extract_email_address (const void *ctx, const char *from) InternetAddressMailbox *mailbox; const char *email = "MAILER-DAEMON"; - addresses = internet_address_list_parse_string (from); + addresses = internet_address_list_parse (NULL, from); /* Bail if there is no address here. */ if (addresses == NULL || internet_address_list_length (addresses) < 1) @@ -278,14 +278,14 @@ show_text_part_content (GMimeObject *part, GMimeStream *stream_out, if (! g_mime_content_type_is_type (content_type, "text", "*")) INTERNAL_ERROR ("Illegal request to format non-text part (%s) as text.", - g_mime_content_type_to_string (content_type)); + g_mime_content_type_get_mime_type (content_type)); if (stream_out == NULL) return; charset = g_mime_object_get_content_type_parameter (part, "charset"); charset = charset ? g_mime_charset_canon_name (charset) : NULL; - wrapper = g_mime_part_get_content_object (GMIME_PART (part)); + wrapper = g_mime_part_get_content (GMIME_PART (part)); if (wrapper && charset && !g_ascii_strncasecmp (charset, "iso-8859-", 9)) { GMimeStream *null_stream = NULL; GMimeStream *null_stream_filter = NULL; @@ -309,7 +309,7 @@ show_text_part_content (GMimeObject *part, GMimeStream *stream_out, } stream_filter = g_mime_stream_filter_new (stream_out); - crlf_filter = g_mime_filter_crlf_new (false, false); + crlf_filter = g_mime_filter_dos2unix_new (false); g_mime_stream_filter_add(GMIME_STREAM_FILTER (stream_filter), crlf_filter); g_object_unref (crlf_filter); @@ -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); @@ -383,30 +383,10 @@ do_format_signature_errors (sprinter_t *sp, struct key_map_struct *key_map, sp->end (sp); } -#if (GMIME_MAJOR_VERSION < 3) static void format_signature_errors (sprinter_t *sp, GMimeSignature *signature) { - GMimeSignatureError errors = g_mime_signature_get_errors (signature); - - if (errors == GMIME_SIGNATURE_ERROR_NONE) - return; - - struct key_map_struct key_map[] = { - { GMIME_SIGNATURE_ERROR_EXPSIG, "sig-expired" }, - { GMIME_SIGNATURE_ERROR_NO_PUBKEY, "key-missing"}, - { GMIME_SIGNATURE_ERROR_EXPKEYSIG, "key-expired"}, - { GMIME_SIGNATURE_ERROR_REVKEYSIG, "key-revoked"}, - { GMIME_SIGNATURE_ERROR_UNSUPP_ALGO, "alg-unsupported"}, - }; - - do_format_signature_errors (sp, key_map, ARRAY_SIZE(key_map), errors); -} -#else -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; @@ -425,7 +405,6 @@ format_signature_errors (sprinter_t *sp, GMimeSignature *signature) do_format_signature_errors (sp, key_map, ARRAY_SIZE(key_map), errors); } -#endif /* Signature status sprinter */ static void @@ -486,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); @@ -545,7 +524,7 @@ format_part_text (const void *ctx, sprinter_t *sp, mime_node_t *node, if (cid) g_mime_stream_printf (stream, ", Content-id: %s", cid); - content_string = g_mime_content_type_to_string (content_type); + content_string = g_mime_content_type_get_mime_type (content_type); g_mime_stream_printf (stream, ", Content-type: %s\n", content_string); g_free (content_string); } @@ -587,7 +566,7 @@ format_part_text (const void *ctx, sprinter_t *sp, mime_node_t *node, { show_text_part_content (node->part, stream, 0); } else { - char *content_string = g_mime_content_type_to_string (content_type); + char *content_string = g_mime_content_type_get_mime_type (content_type); g_mime_stream_printf (stream, "Non-text part: %s\n", content_string); g_free (content_string); } @@ -609,7 +588,7 @@ format_omitted_part_meta_sprinter (sprinter_t *sp, GMimeObject *meta, GMimePart { const char *content_charset = g_mime_object_get_content_type_parameter (meta, "charset"); const char *cte = g_mime_object_get_header (meta, "content-transfer-encoding"); - GMimeDataWrapper *wrapper = g_mime_part_get_content_object (part); + GMimeDataWrapper *wrapper = g_mime_part_get_content (part); GMimeStream *stream = g_mime_data_wrapper_get_stream (wrapper); ssize_t content_length = g_mime_stream_length (stream); @@ -686,7 +665,7 @@ format_part_sprinter (const void *ctx, sprinter_t *sp, mime_node_t *node, } sp->map_key (sp, "content-type"); - content_string = g_mime_content_type_to_string (content_type); + content_string = g_mime_content_type_get_mime_type (content_type); sp->string (sp, content_string); g_free (content_string); @@ -872,7 +851,7 @@ format_part_raw (unused (const void *ctx), unused (sprinter_t *sp), /* For leaf parts, we emit only the transfer-decoded * body. */ GMimeDataWrapper *wrapper; - wrapper = g_mime_part_get_content_object (GMIME_PART (node->part)); + wrapper = g_mime_part_get_content (GMIME_PART (node->part)); if (wrapper && stream_filter) g_mime_data_wrapper_write_to_stream (wrapper, stream_filter); @@ -883,7 +862,7 @@ format_part_raw (unused (const void *ctx), unused (sprinter_t *sp), * encapsulating part's headers). For multipart parts, * this will include the headers. */ if (stream_filter) - g_mime_object_write_to_stream (node->part, stream_filter); + g_mime_object_write_to_stream (node->part, NULL, stream_filter); } if (stream_filter) @@ -915,7 +894,6 @@ show_message (void *ctx, part = mime_node_seek_dfs (root, (params->part < 0 ? 0 : params->part)); if (part) status = format->part (local, sp, part, indent, params); -#if HAVE_GMIME_SESSION_KEYS if (params->crypto.decrypt == NOTMUCH_DECRYPT_TRUE && session_key_count_error == NOTMUCH_STATUS_SUCCESS) { unsigned int new_session_keys = 0; if (notmuch_message_count_properties (message, "session-key", &new_session_keys) == NOTMUCH_STATUS_SUCCESS && @@ -929,7 +907,6 @@ show_message (void *ctx, } } } -#endif DONE: talloc_free (local); return status; @@ -1234,10 +1211,6 @@ notmuch_show_command (notmuch_config_t *config, int argc, char *argv[]) return EXIT_FAILURE; } -#if (GMIME_MAJOR_VERSION < 3) - params.crypto.gpgpath = notmuch_config_get_crypto_gpg_path (config); -#endif - notmuch_database_mode_t mode = NOTMUCH_DATABASE_MODE_READ_ONLY; if (params.crypto.decrypt == NOTMUCH_DECRYPT_TRUE) mode = NOTMUCH_DATABASE_MODE_READ_WRITE;