[evolution-mapi/wip/camel-more-gobject] Bug 773787 - Replace CamelHeaderRaw by CamelNameValueArray
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-mapi/wip/camel-more-gobject] Bug 773787 - Replace CamelHeaderRaw by CamelNameValueArray
- Date: Fri, 4 Nov 2016 12:14:55 +0000 (UTC)
commit e7734fa58900b12d98db7b57569f5f1e6ca6be08
Author: Milan Crha <mcrha redhat com>
Date: Fri Nov 4 13:15:00 2016 +0100
Bug 773787 - Replace CamelHeaderRaw by CamelNameValueArray
src/camel/camel-mapi-folder.c | 4 +++-
src/libexchangemapi/e-mapi-mail-utils.c | 21 ++++++++++++++-------
2 files changed, 17 insertions(+), 8 deletions(-)
---
diff --git a/src/camel/camel-mapi-folder.c b/src/camel/camel-mapi-folder.c
index ea30c70..9292ea5 100644
--- a/src/camel/camel-mapi-folder.c
+++ b/src/camel/camel-mapi-folder.c
@@ -621,7 +621,9 @@ gather_object_summary_cb (EMapiConnection *conn,
g_object_unref (stream);
if (camel_mime_part_construct_from_parser_sync (part, parser, NULL, NULL)) {
- info = camel_folder_summary_info_new_from_header
(camel_folder_get_folder_summary (gos->folder), part->headers);
+ info = camel_folder_summary_info_new_from_headers (
+ camel_folder_get_folder_summary (gos->folder),
+ camel_medium_get_headers (CAMEL_MEDIUM (part)));
if (info) {
const uint32_t *msg_size;
diff --git a/src/libexchangemapi/e-mapi-mail-utils.c b/src/libexchangemapi/e-mapi-mail-utils.c
index c40a6d3..ef3155a 100644
--- a/src/libexchangemapi/e-mapi-mail-utils.c
+++ b/src/libexchangemapi/e-mapi-mail-utils.c
@@ -778,20 +778,27 @@ e_mapi_mail_utils_object_to_message (EMapiConnection *conn, /* const */ EMapiObj
g_object_unref (stream);
if (camel_mime_part_construct_from_parser_sync (part, parser, NULL, NULL)) {
- struct _camel_header_raw *h;
+ const CamelNameValueArray *headers;
+ CamelMedium *msg_medium = CAMEL_MEDIUM (msg);
+ guint ii, len;
- for (h = part->headers; h; h = h->next) {
- const gchar *value = h->value;
+ headers = camel_medium_get_headers (CAMEL_MEDIUM (part));
+ len = camel_name_value_array_get_length (headers);
+
+ for (ii = 0; ii < len; ii++) {
+ const gchar *header_name = NULL, *header_value = NULL;
/* skip all headers describing content of a message,
because it's overwritten on message decomposition */
- if (g_ascii_strncasecmp (h->name, "Content", 7) == 0)
+ if (!camel_name_value_array_get (headers, ii, &header_name, &header_value) ||
+ !header_name ||
+ g_ascii_strncasecmp (header_name, "Content", 7) == 0)
continue;
- while (value && camel_mime_is_lwsp (*value))
- value++;
+ while (header_value && camel_mime_is_lwsp (*header_value))
+ header_value++;
- camel_medium_add_header (CAMEL_MEDIUM (msg), h->name, value);
+ camel_medium_add_header (msg_medium, header_name, header_value);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]