[evolution/wip/camel-more-gobject] Seal CamelMimeMessage properties



commit ebd8fcf6d45d0b0ca63061179c532e55e7335d2c
Author: Milan Crha <mcrha redhat com>
Date:   Thu Nov 3 14:19:58 2016 +0100

    Seal CamelMimeMessage properties

 src/mail/mail-autofilter.c              |    6 +++++-
 src/modules/mail/e-mail-shell-backend.c |    2 +-
 src/plugins/mail-to-task/mail-to-task.c |   18 ++++++++----------
 3 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/src/mail/mail-autofilter.c b/src/mail/mail-autofilter.c
index 46e517a..36344fd 100644
--- a/src/mail/mail-autofilter.c
+++ b/src/mail/mail-autofilter.c
@@ -238,9 +238,13 @@ rule_from_message (EFilterRule *rule,
        rule->grouping = E_FILTER_GROUP_ALL;
 
        if (flags & AUTO_SUBJECT) {
-               const gchar *subject = msg->subject ? msg->subject : "";
+               const gchar *subject;
                gchar *namestr;
 
+               subject = camel_mime_message_get_subject (msg);
+               if (!subject)
+                       subject = "";
+
                rule_match_subject (context, rule, subject);
 
                namestr = g_strdup_printf (_("Subject is %s"), strip_re (subject));
diff --git a/src/modules/mail/e-mail-shell-backend.c b/src/modules/mail/e-mail-shell-backend.c
index 09e157e..9d69d28 100644
--- a/src/modules/mail/e-mail-shell-backend.c
+++ b/src/modules/mail/e-mail-shell-backend.c
@@ -159,7 +159,7 @@ mbox_fill_preview_cb (GObject *preview,
 
        parser = e_mail_parser_new (CAMEL_SESSION (mail_session));
        e_mail_parser_parse (
-               parser, NULL, msg->message_id, msg,
+               parser, NULL, camel_mime_message_get_message_id (msg), msg,
                message_parsed_cb, NULL, preview);
 
        g_object_unref (mail_session);
diff --git a/src/plugins/mail-to-task/mail-to-task.c b/src/plugins/mail-to-task/mail-to-task.c
index 7099edb..0b334ed 100644
--- a/src/plugins/mail-to-task/mail-to-task.c
+++ b/src/plugins/mail-to-task/mail-to-task.c
@@ -106,13 +106,12 @@ set_attendees (ECalComponent *comp,
 {
        GSList *attendees = NULL, *to_free = NULL;
        ECalComponentAttendee *ca;
-       CamelInternetAddress *from = NULL, *to, *cc, *bcc, *arr[4];
+       CamelInternetAddress *from, *to, *cc, *bcc, *arr[4];
        gint len, i, j;
 
-       if (message->reply_to)
-               from = message->reply_to;
-       else if (message->from)
-               from = message->from;
+       from = camel_mime_message_get_reply_to (message);
+       if (!from)
+               from = camel_mime_message_get_from (message);
 
        to = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO);
        cc = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC);
@@ -177,15 +176,14 @@ prepend_from (CamelMimeMessage *message,
 {
        gchar *res, *tmp, *addr = NULL;
        const gchar *name = NULL, *eml = NULL;
-       CamelInternetAddress *from = NULL;
+       CamelInternetAddress *from;
 
        g_return_val_if_fail (message != NULL, NULL);
        g_return_val_if_fail (text != NULL, NULL);
 
-       if (message->reply_to)
-               from = message->reply_to;
-       else if (message->from)
-               from = message->from;
+       from = camel_mime_message_get_reply_to (message);
+       if (!from)
+               from = camel_mime_message_get_from (message);
 
        if (from && camel_internet_address_get (from, 0, &name, &eml))
                addr = camel_internet_address_format_address (name, eml);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]