mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
gmime-cleanup: pass NULL arguments explicitly where GMime 3.0 expects it
Several GMime 2.6 functions sprouted a change in the argument order in GMime 3.0. We had a compatibility layer here to be able to handle compiling against both GMime 2.6 and 3.0. Now that we're using 3.0 only, rip out the compatibility layer for those functions with changed argument lists, and explicitly use the 3.0 argument lists. Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
This commit is contained in:
parent
582f255aeb
commit
bbe3015b3e
7 changed files with 13 additions and 20 deletions
|
@ -212,7 +212,7 @@ static char *
|
||||||
_extend_header (char *combined, const char *value) {
|
_extend_header (char *combined, const char *value) {
|
||||||
char *decoded;
|
char *decoded;
|
||||||
|
|
||||||
decoded = g_mime_utils_header_decode_text (value);
|
decoded = g_mime_utils_header_decode_text (NULL, value);
|
||||||
if (! decoded) {
|
if (! decoded) {
|
||||||
if (combined) {
|
if (combined) {
|
||||||
g_free (combined);
|
g_free (combined);
|
||||||
|
@ -296,7 +296,7 @@ _notmuch_message_file_get_header (notmuch_message_file_t *message,
|
||||||
value = g_mime_object_get_header (GMIME_OBJECT (message->message),
|
value = g_mime_object_get_header (GMIME_OBJECT (message->message),
|
||||||
header);
|
header);
|
||||||
if (value)
|
if (value)
|
||||||
decoded = g_mime_utils_header_decode_text (value);
|
decoded = g_mime_utils_header_decode_text (NULL, value);
|
||||||
else
|
else
|
||||||
decoded = g_strdup ("");
|
decoded = g_strdup ("");
|
||||||
}
|
}
|
||||||
|
|
|
@ -284,7 +284,7 @@ _thread_add_message (notmuch_thread_t *thread,
|
||||||
|
|
||||||
from = notmuch_message_get_header (message, "from");
|
from = notmuch_message_get_header (message, "from");
|
||||||
if (from)
|
if (from)
|
||||||
list = internet_address_list_parse_string (from);
|
list = internet_address_list_parse (NULL, from);
|
||||||
|
|
||||||
if (list) {
|
if (list) {
|
||||||
address = internet_address_list_get_address (list, 0);
|
address = internet_address_list_get_address (list, 0);
|
||||||
|
|
|
@ -176,7 +176,7 @@ node_verify (mime_node_t *node, GMimeObject *part)
|
||||||
|
|
||||||
node->verify_attempted = true;
|
node->verify_attempted = true;
|
||||||
node->sig_list = g_mime_multipart_signed_verify
|
node->sig_list = g_mime_multipart_signed_verify
|
||||||
(GMIME_MULTIPART_SIGNED (part), cryptoctx, &err);
|
(GMIME_MULTIPART_SIGNED (part), GMIME_ENCRYPT_NONE, &err);
|
||||||
|
|
||||||
if (node->sig_list)
|
if (node->sig_list)
|
||||||
set_signature_list_destructor (node);
|
set_signature_list_destructor (node);
|
||||||
|
|
|
@ -28,7 +28,7 @@ static void
|
||||||
show_reply_headers (GMimeStream *stream, GMimeMessage *message)
|
show_reply_headers (GMimeStream *stream, GMimeMessage *message)
|
||||||
{
|
{
|
||||||
/* Output RFC 2822 formatted (and RFC 2047 encoded) headers. */
|
/* Output RFC 2822 formatted (and RFC 2047 encoded) headers. */
|
||||||
if (g_mime_object_write_to_stream (GMIME_OBJECT(message), stream) < 0) {
|
if (g_mime_object_write_to_stream (GMIME_OBJECT(message), NULL, stream) < 0) {
|
||||||
INTERNAL_ERROR("failed to write headers to stdout\n");
|
INTERNAL_ERROR("failed to write headers to stdout\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -541,7 +541,7 @@ create_reply_message(void *ctx,
|
||||||
in_reply_to = talloc_asprintf (ctx, "<%s>",
|
in_reply_to = talloc_asprintf (ctx, "<%s>",
|
||||||
notmuch_message_get_message_id (message));
|
notmuch_message_get_message_id (message));
|
||||||
|
|
||||||
g_mime_object_set_header (GMIME_OBJECT (reply), "In-Reply-To", in_reply_to);
|
g_mime_object_set_header (GMIME_OBJECT (reply), "In-Reply-To", in_reply_to, NULL);
|
||||||
|
|
||||||
orig_references = notmuch_message_get_header (message, "references");
|
orig_references = notmuch_message_get_header (message, "references");
|
||||||
if (orig_references && *orig_references)
|
if (orig_references && *orig_references)
|
||||||
|
@ -550,7 +550,7 @@ create_reply_message(void *ctx,
|
||||||
else
|
else
|
||||||
references = talloc_strdup (ctx, in_reply_to);
|
references = talloc_strdup (ctx, in_reply_to);
|
||||||
|
|
||||||
g_mime_object_set_header (GMIME_OBJECT (reply), "References", references);
|
g_mime_object_set_header (GMIME_OBJECT (reply), "References", references, NULL);
|
||||||
|
|
||||||
from_addr = add_recipients_from_message (reply, config,
|
from_addr = add_recipients_from_message (reply, config,
|
||||||
mime_message, reply_all);
|
mime_message, reply_all);
|
||||||
|
@ -589,13 +589,13 @@ create_reply_message(void *ctx,
|
||||||
from_addr = talloc_asprintf (ctx, "%s <%s>",
|
from_addr = talloc_asprintf (ctx, "%s <%s>",
|
||||||
notmuch_config_get_user_name (config),
|
notmuch_config_get_user_name (config),
|
||||||
from_addr);
|
from_addr);
|
||||||
g_mime_object_set_header (GMIME_OBJECT (reply), "From", from_addr);
|
g_mime_object_set_header (GMIME_OBJECT (reply), "From", from_addr, NULL);
|
||||||
|
|
||||||
subject = notmuch_message_get_header (message, "subject");
|
subject = notmuch_message_get_header (message, "subject");
|
||||||
if (subject) {
|
if (subject) {
|
||||||
if (strncasecmp (subject, "Re:", 3))
|
if (strncasecmp (subject, "Re:", 3))
|
||||||
subject = talloc_asprintf (ctx, "Re: %s", subject);
|
subject = talloc_asprintf (ctx, "Re: %s", subject);
|
||||||
g_mime_message_set_subject (reply, subject);
|
g_mime_message_set_subject (reply, subject, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
return reply;
|
return reply;
|
||||||
|
|
|
@ -364,7 +364,7 @@ print_mailbox (const search_context_t *ctx, const mailbox_t *mailbox)
|
||||||
|
|
||||||
/* name_addr has the name part quoted if necessary. Compare
|
/* name_addr has the name part quoted if necessary. Compare
|
||||||
* 'John Doe <john@doe.com>' vs. '"Doe, John" <john@doe.com>' */
|
* 'John Doe <john@doe.com>' vs. '"Doe, John" <john@doe.com>' */
|
||||||
name_addr = internet_address_to_string (ia, false);
|
name_addr = internet_address_to_string (ia, NULL, false);
|
||||||
|
|
||||||
if (format->is_text_printer) {
|
if (format->is_text_printer) {
|
||||||
if (ctx->output & OUTPUT_COUNT) {
|
if (ctx->output & OUTPUT_COUNT) {
|
||||||
|
@ -446,7 +446,7 @@ process_address_header (const search_context_t *ctx, const char *value)
|
||||||
if (value == NULL)
|
if (value == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
list = internet_address_list_parse_string (value);
|
list = internet_address_list_parse (NULL, value);
|
||||||
if (list == NULL)
|
if (list == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ _extract_email_address (const void *ctx, const char *from)
|
||||||
InternetAddressMailbox *mailbox;
|
InternetAddressMailbox *mailbox;
|
||||||
const char *email = "MAILER-DAEMON";
|
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. */
|
/* Bail if there is no address here. */
|
||||||
if (addresses == NULL || internet_address_list_length (addresses) < 1)
|
if (addresses == NULL || internet_address_list_length (addresses) < 1)
|
||||||
|
@ -862,7 +862,7 @@ format_part_raw (unused (const void *ctx), unused (sprinter_t *sp),
|
||||||
* encapsulating part's headers). For multipart parts,
|
* encapsulating part's headers). For multipart parts,
|
||||||
* this will include the headers. */
|
* this will include the headers. */
|
||||||
if (stream_filter)
|
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)
|
if (stream_filter)
|
||||||
|
|
|
@ -9,14 +9,7 @@ extern "C" {
|
||||||
|
|
||||||
GMimeStream *g_mime_stream_stdout_new(void);
|
GMimeStream *g_mime_stream_stdout_new(void);
|
||||||
|
|
||||||
#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_parser_construct_message(p) g_mime_parser_construct_message (p, g_mime_parser_options_get_default ())
|
||||||
#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)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get last 16 hex digits of fingerprint ("keyid")
|
* Get last 16 hex digits of fingerprint ("keyid")
|
||||||
|
|
Loading…
Reference in a new issue