From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: Notmuch Mail <notmuch@notmuchmail.org>
Subject: [PATCH 11/16] gmime-cleanup: use GMime 3.0 function names
Date: Thu, 2 May 2019 01:16:48 -0400 [thread overview]
Message-ID: <20190502051653.8502-12-dkg@fifthhorseman.net> (raw)
In-Reply-To: <20190502051653.8502-1-dkg@fifthhorseman.net>
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
---
lib/index.cc | 4 ++--
notmuch-reply.c | 8 ++++----
notmuch-show.c | 16 ++++++++--------
| 4 ----
4 files changed, 14 insertions(+), 18 deletions(-)
diff --git a/lib/index.cc b/lib/index.cc
index f21761d0..41822488 100644
--- a/lib/index.cc
+++ b/lib/index.cc
@@ -357,7 +357,7 @@ _index_content_type (notmuch_message_t *message, GMimeObject *part)
{
GMimeContentType *content_type = g_mime_object_get_content_type (part);
if (content_type) {
- char *mime_string = g_mime_content_type_to_string (content_type);
+ char *mime_string = g_mime_content_type_get_mime_type (content_type);
if (mime_string) {
_notmuch_message_gen_terms (message, "mimetype", mime_string);
g_free (mime_string);
@@ -493,7 +493,7 @@ _index_mime_part (notmuch_message_t *message,
}
}
- wrapper = g_mime_part_get_content_object (GMIME_PART (part));
+ wrapper = g_mime_part_get_content (GMIME_PART (part));
if (wrapper)
g_mime_data_wrapper_write_to_stream (wrapper, filter);
diff --git a/notmuch-reply.c b/notmuch-reply.c
index 35b6645b..a8bb3929 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -75,10 +75,10 @@ format_part_reply (GMimeStream *stream, mime_node_t *node)
GMIME_DISPOSITION_ATTACHMENT) == 0) {
const char *filename = g_mime_part_get_filename (GMIME_PART (node->part));
g_mime_stream_printf (stream, "Attachment: %s (%s)\n", filename,
- g_mime_content_type_to_string (content_type));
+ g_mime_content_type_get_mime_type (content_type));
} else {
g_mime_stream_printf (stream, "Non-text part: %s\n",
- g_mime_content_type_to_string (content_type));
+ g_mime_content_type_get_mime_type (content_type));
}
}
@@ -209,7 +209,7 @@ scan_address_list (InternetAddressList *list,
if (user_from && *user_from == NULL)
*user_from = addr;
} else if (message) {
- g_mime_message_add_recipient (message, type, name, addr);
+ g_mime_message_add_mailbox (message, type, name, addr);
n++;
}
}
@@ -373,7 +373,7 @@ add_recipients_from_message (GMimeMessage *reply,
* of recipients so that the reply goes back to the user.
*/
if (n == 0 && from_addr)
- g_mime_message_add_recipient (reply, GMIME_ADDRESS_TYPE_TO, NULL, from_addr);
+ g_mime_message_add_mailbox (reply, GMIME_ADDRESS_TYPE_TO, NULL, from_addr);
return from_addr;
}
diff --git a/notmuch-show.c b/notmuch-show.c
index 108505d0..90f6d815 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -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);
@@ -524,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);
}
@@ -566,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);
}
@@ -588,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);
@@ -665,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);
@@ -851,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);
--git a/util/gmime-extra.h b/util/gmime-extra.h
index a183952d..e6ba45b6 100644
--- a/util/gmime-extra.h
+++ b/util/gmime-extra.h
@@ -9,15 +9,11 @@ extern "C" {
GMimeStream *g_mime_stream_stdout_new(void);
-#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_message_add_recipient(m,t,n,a) g_mime_message_add_mailbox (m,t,n,a)
#define g_mime_message_set_subject(m,s) g_mime_message_set_subject(m,s,NULL)
#define g_mime_multipart_signed_verify(mps,ctx,err) g_mime_multipart_signed_verify(mps, GMIME_ENCRYPT_NONE, err)
#define g_mime_object_write_to_stream(o,s) g_mime_object_write_to_stream (o,NULL,s)
#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_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)
--
2.20.1
next prev parent reply other threads:[~2019-05-02 5:17 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-01 10:46 [PATCH] build: drop support for gmime-2.6 David Bremner
2019-05-01 19:58 ` Tomi Ollila
2019-05-01 20:37 ` David Bremner
2019-05-01 20:14 ` Daniel Kahn Gillmor
2019-05-01 20:35 ` David Bremner
2019-05-01 20:41 ` Rollins, Jameson
2019-05-02 1:07 ` David Bremner
2019-05-02 2:21 ` Rollins, Jameson
2019-05-02 5:16 ` Dropping GMime 2.6 compatibility layer Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 01/16] gmime-cleanup: drop unused gmime 2.6 content_type from _index_encrypted_mime_part Daniel Kahn Gillmor
2019-05-02 9:40 ` David Bremner
2019-05-02 5:16 ` [PATCH 02/16] gmime-cleanup: remove GMime 2.6 variant codeblocks Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 03/16] gmime-cleanup: remove obsolete gpg_path configuration option and crypto contexts Daniel Kahn Gillmor
2019-05-02 9:50 ` David Bremner
2019-05-02 13:01 ` Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 04/16] gmime-cleanup: always support session keys Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 05/16] gmime-cleanup: tests should only care about gmime 3 Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 06/16] gmime-cleanup: simplify T355-smime.sh Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 07/16] gmime-cleanup: drop g_mime_2_6_unref Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 08/16] gmime-cleanup: drop all unused GMimeCryptoContext arguments Daniel Kahn Gillmor
2019-05-02 10:03 ` David Bremner
2019-05-02 5:16 ` [PATCH 09/16] gmime-cleanup: drop unused gmime #defines and simplify g_mime_init () Daniel Kahn Gillmor
2019-05-02 9:24 ` David Bremner
2019-05-02 5:16 ` [PATCH 10/16] gmime-cleanup: use GMime 3.0 data types Daniel Kahn Gillmor
2019-05-02 5:16 ` Daniel Kahn Gillmor [this message]
2019-05-02 5:16 ` [PATCH 12/16] gmime-cleanup: pass NULL arguments explicitly where GMime 3.0 expects it Daniel Kahn Gillmor
2019-05-02 10:06 ` David Bremner
2019-05-02 5:16 ` [PATCH 13/16] gmime-cleanup: pass NULL as default GMimeParserOptions Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 14/16] gmime-cleanup: no longer need to use GMime major version during build Daniel Kahn Gillmor
2019-05-02 10:10 ` David Bremner
2019-05-02 13:09 ` Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 15/16] gmime-cleanup: use GMIME_MINVER instead of GMIME3_MINVER Daniel Kahn Gillmor
2019-05-02 5:16 ` [PATCH 16/16] gmime-cleanup: strip remaining references to GMime 2.6 Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 01/15] build: drop support for gmime-2.6 Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 02/15] gmime-cleanup: drop unused gmime 2.6 content_type from _index_encrypted_mime_part Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 03/15] gmime-cleanup: remove GMime 2.6 variant codeblocks Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 04/15] gmime-cleanup: remove obsolete gpg_path configuration option and crypto contexts Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 05/15] gmime-cleanup: always support session keys Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 06/15] gmime-cleanup: tests should only care about gmime 3 Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 07/15] gmime-cleanup: simplify T355-smime.sh Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 08/15] gmime-cleanup: drop g_mime_2_6_unref Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 09/15] gmime-cleanup: drop all arguments unused in GMime 3 Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 10/15] gmime-cleanup: drop unused gmime #defines and simplify g_mime_init () Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 11/15] gmime-cleanup: use GMime 3.0 data types Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 12/15] gmime-cleanup: use GMime 3.0 function names Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 13/15] gmime-cleanup: pass NULL arguments explicitly where GMime 3.0 expects it Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 14/15] gmime-cleanup: pass NULL as default GMimeParserOptions Daniel Kahn Gillmor
2019-05-02 13:19 ` [PATCH v2 15/15] gmime-cleanup: no longer need to use GMime major version during build Daniel Kahn Gillmor
2019-05-03 10:43 ` [PATCH v2 01/15] build: drop support for gmime-2.6 David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190502051653.8502-12-dkg@fifthhorseman.net \
--to=dkg@fifthhorseman.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).