Added support for setting References and In-Reply-To: mime fields
[modest] / src / modest-mail-operation.c
index 4ca9397..61eead7 100644 (file)
@@ -231,6 +231,7 @@ static void          modest_mail_operation_create_msg (ModestMailOperation *self
                                                       const gchar *html_body, const GList *attachments_list,
                                                       const GList *images_list,
                                                       TnyHeaderFlags priority_flags,
+                                                      const gchar *references, const gchar *in_reply_to,
                                                       ModestMailOperationCreateMsgCallback callback,
                                                       gpointer userdata);
 
@@ -243,6 +244,8 @@ typedef struct
        gchar *cc;
        gchar *bcc;
        gchar *subject;
+       gchar *references;
+       gchar *in_reply_to;
        gchar *plain_body;
        gchar *html_body;
        GList *attachments_list;
@@ -828,12 +831,16 @@ create_msg_thread (gpointer thread_data)
        priv = MODEST_MAIL_OPERATION_GET_PRIVATE(info->mail_op);
        if (info->html_body == NULL) {
                new_msg = modest_tny_msg_new (info->to, info->from, info->cc, 
-                                             info->bcc, info->subject, info->plain_body, 
+                                             info->bcc, info->subject, 
+                                             info->references, info->in_reply_to,
+                                             info->plain_body, 
                                              info->attachments_list, &attached,
                                              &(priv->error));
        } else {
                new_msg = modest_tny_msg_new_html_plain (info->to, info->from, info->cc,
-                                                        info->bcc, info->subject, info->html_body,
+                                                        info->bcc, info->subject, 
+                                                        info->references, info->in_reply_to,
+                                                        info->html_body,
                                                         info->plain_body, info->attachments_list,
                                                         info->images_list, &attached,
                                                         &(priv->error));
@@ -867,6 +874,8 @@ create_msg_thread (gpointer thread_data)
        g_free (info->plain_body);
        g_free (info->html_body);
        g_free (info->subject);
+       g_free (info->references);
+       g_free (info->in_reply_to);
        g_list_foreach (info->attachments_list, (GFunc) g_object_unref, NULL);
        g_list_free (info->attachments_list);
        g_list_foreach (info->images_list, (GFunc) g_object_unref, NULL);
@@ -900,6 +909,8 @@ modest_mail_operation_create_msg (ModestMailOperation *self,
                                  const GList *attachments_list,
                                  const GList *images_list,
                                  TnyHeaderFlags priority_flags,
+                                 const gchar *references,
+                                 const gchar *in_reply_to,
                                  ModestMailOperationCreateMsgCallback callback,
                                  gpointer userdata)
 {
@@ -915,6 +926,8 @@ modest_mail_operation_create_msg (ModestMailOperation *self,
        info->subject = g_strdup (subject);
        info->plain_body = g_strdup (plain_body);
        info->html_body = g_strdup (html_body);
+       info->references = g_strdup (references);
+       info->in_reply_to = g_strdup (in_reply_to);
        info->attachments_list = g_list_copy ((GList *) attachments_list);
        g_list_foreach (info->attachments_list, (GFunc) g_object_ref, NULL);
        info->images_list = g_list_copy ((GList *) images_list);
@@ -1074,6 +1087,8 @@ modest_mail_operation_send_new_mail (ModestMailOperation *self,
                                     const gchar *html_body,
                                     const GList *attachments_list,
                                     const GList *images_list,
+                                    const gchar *references,
+                                    const gchar *in_reply_to,
                                     TnyHeaderFlags priority_flags)
 {
        ModestMailOperationPrivate *priv = NULL;
@@ -1110,6 +1125,7 @@ modest_mail_operation_send_new_mail (ModestMailOperation *self,
 
        modest_mail_operation_create_msg (self, from, to, cc, bcc, subject, plain_body, html_body,
                                          attachments_list, images_list, priority_flags,
+                                         references, in_reply_to,
                                          modest_mail_operation_send_new_mail_cb, info);
 
 }
@@ -1272,6 +1288,8 @@ modest_mail_operation_save_to_drafts (ModestMailOperation *self,
                                      const GList *attachments_list,
                                      const GList *images_list,
                                      TnyHeaderFlags priority_flags,
+                                     const gchar *references,
+                                     const gchar *in_reply_to,
                                      SaveToDraftstCallback callback,
                                      gpointer user_data)
 {
@@ -1297,6 +1315,7 @@ modest_mail_operation_save_to_drafts (ModestMailOperation *self,
        modest_mail_operation_notify_start (self);
        modest_mail_operation_create_msg (self, from, to, cc, bcc, subject, plain_body, html_body,
                                          attachments_list, images_list, priority_flags,
+                                         references, in_reply_to,
                                          modest_mail_operation_save_to_drafts_cb, info);
 }