[gmime: 1/3] Re-use the ensure_newline field instead of needing message->compliance
- From: Jeffrey Stedfast <fejj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gmime: 1/3] Re-use the ensure_newline field instead of needing message->compliance
- Date: Mon, 3 Apr 2017 13:12:52 +0000 (UTC)
commit f412f3e711efe041a738cd487354b6935c16417f
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date: Mon Apr 3 08:56:42 2017 -0400
Re-use the ensure_newline field instead of needing message->compliance
TODO | 2 --
gmime/gmime-message.c | 4 ++--
gmime/gmime-message.h | 1 -
gmime/gmime-parser.c | 4 ++--
4 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/TODO b/TODO
index d32a0ca..c235b9d 100644
--- a/TODO
+++ b/TODO
@@ -10,8 +10,6 @@ GMime 3.0 Planning:
This would require me to rename g_mime_message_get_body() to
g_mime_message_get_text_body()?
-- Other GMimeParser improvements based on MimeKit
-
Future Planning:
================
diff --git a/gmime/gmime-message.c b/gmime/gmime-message.c
index 752e5a2..e30da0e 100644
--- a/gmime/gmime-message.c
+++ b/gmime/gmime-message.c
@@ -193,7 +193,7 @@ g_mime_message_init (GMimeMessage *message, GMimeMessageClass *klass)
guint i;
message->addrlists = g_new (InternetAddressList *, N_ADDRESS_TYPES);
- message->compliance = GMIME_RFC_COMPLIANCE_STRICT;
+ ((GMimeObject *) message)->ensure_newline = TRUE;
message->message_id = NULL;
message->mime_part = NULL;
message->subject = NULL;
@@ -574,7 +574,7 @@ message_write_to_stream (GMimeObject *object, GMimeFormatOptions *options, gbool
GMimeObjectClass *klass = GMIME_OBJECT_GET_CLASS (mime_part);
options = _g_mime_format_options_clone (options, FALSE);
- mime_part->ensure_newline = message->compliance == GMIME_RFC_COMPLIANCE_STRICT;
+ mime_part->ensure_newline = ((GMimeObject *) message)->ensure_newline;
nwritten = klass->write_to_stream (mime_part, options, TRUE, stream);
mime_part->ensure_newline = FALSE;
diff --git a/gmime/gmime-message.h b/gmime/gmime-message.h
index 5a2a918..9cabd6f 100644
--- a/gmime/gmime-message.h
+++ b/gmime/gmime-message.h
@@ -86,7 +86,6 @@ struct _GMimeMessage {
char *subject;
/* < private > */
- GMimeRfcComplianceMode compliance;
char *marker;
};
diff --git a/gmime/gmime-parser.c b/gmime/gmime-parser.c
index fdc14df..8c5c6d4 100644
--- a/gmime/gmime-parser.c
+++ b/gmime/gmime-parser.c
@@ -1663,7 +1663,7 @@ parser_scan_message_part (GMimeParser *parser, GMimeParserOptions *options, GMim
}
message = g_mime_message_new (FALSE);
- message->compliance = GMIME_RFC_COMPLIANCE_LOOSE;
+ ((GMimeObject *) message)->ensure_newline = FALSE;
message->marker = priv->preheader;
priv->preheader = NULL;
@@ -1980,7 +1980,7 @@ parser_construct_message (GMimeParser *parser, GMimeParserOptions *options)
}
message = g_mime_message_new (FALSE);
- message->compliance = GMIME_RFC_COMPLIANCE_LOOSE;
+ ((GMimeObject *) message)->ensure_newline = FALSE;
for (i = 0; i < priv->headers->len; i++) {
header = priv->headers->pdata[i];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]