[evolution-mapi/wip/camel-more-gobject] Bug 773731 - Port CamelMedium to CamelNameValueArray
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-mapi/wip/camel-more-gobject] Bug 773731 - Port CamelMedium to CamelNameValueArray
- Date: Mon, 31 Oct 2016 21:17:38 +0000 (UTC)
commit b45cf9966ccc6ef46d8532b13305260676f5ed41
Author: Milan Crha <mcrha redhat com>
Date: Mon Oct 31 22:17:19 2016 +0100
Bug 773731 - Port CamelMedium to CamelNameValueArray
src/libexchangemapi/e-mapi-mail-utils.c | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/libexchangemapi/e-mapi-mail-utils.c b/src/libexchangemapi/e-mapi-mail-utils.c
index 7f5d5ad..72ffbf9 100644
--- a/src/libexchangemapi/e-mapi-mail-utils.c
+++ b/src/libexchangemapi/e-mapi-mail-utils.c
@@ -1553,7 +1553,7 @@ e_mapi_mail_utils_message_to_object (struct _CamelMimeMessage *message,
if ((create_flags & E_MAPI_CREATE_FLAG_SUBMIT) == 0) {
time_t msg_time = 0;
gint msg_time_offset = 0;
- GArray *headers;
+ CamelNameValueArray *headers;
if (namep && *namep)
set_value (PidTagSentRepresentingName, namep);
@@ -1586,17 +1586,21 @@ e_mapi_mail_utils_message_to_object (struct _CamelMimeMessage *message,
headers = camel_medium_get_headers (CAMEL_MEDIUM (message));
if (headers) {
GString *hstr = g_string_new ("");
+ guint len;
- for (ii = 0; ii < headers->len; ii++) {
- CamelMediumHeader *h = &g_array_index (headers, CamelMediumHeader, ii);
+ len = camel_name_value_array_get_length (headers);
- if (!h->name || !*h->name || g_ascii_strncasecmp (h->name, "X-Evolution", 11)
== 0)
+ for (ii = 0; ii < len; ii++) {
+ const gchar *header_name = NULL, *header_value = NULL;
+
+ if (!camel_name_value_array_get (headers, ii, &header_name, &header_value) ||
+ !header_name || !*header_name || g_ascii_strncasecmp (header_name,
"X-Evolution", 11) == 0)
continue;
- g_string_append_printf (hstr, "%s: %s\n", h->name, h->value ? h->value : "");
+ g_string_append_printf (hstr, "%s: %s\n", header_name, header_value ?
header_value : "");
}
- camel_medium_free_headers (CAMEL_MEDIUM (message), headers);
+ camel_name_value_array_free (headers);
if (hstr->len && hstr->str)
set_value (PidTagTransportMessageHeaders, hstr->str);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]