Preserver headers of messages in drafts and sending messages.
[modest] / src / modest-mail-operation.c
index 2a0176e..020ad46 100644 (file)
@@ -246,6 +246,7 @@ static void          modest_mail_operation_create_msg (ModestMailOperation *self
                                                       const GList *images_list,
                                                       TnyHeaderFlags priority_flags,
                                                       const gchar *references, const gchar *in_reply_to,
+                                                      TnyList *header_pairs,
                                                       ModestMailOperationCreateMsgCallback callback,
                                                       gpointer userdata);
 
@@ -265,6 +266,7 @@ typedef struct
        GList *attachments_list;
        GList *images_list;
        TnyHeaderFlags priority_flags;
+       TnyList *header_pairs;
        ModestMailOperationCreateMsgCallback callback;
        gpointer userdata;
 } CreateMsgInfo;
@@ -853,6 +855,7 @@ create_msg_thread (gpointer thread_data)
                                              info->references, info->in_reply_to,
                                              info->plain_body, 
                                              info->attachments_list, &attached,
+                                             info->header_pairs,
                                              &(priv->error));
        } else {
                new_msg = modest_tny_msg_new_html_plain (info->to, info->from, info->cc,
@@ -861,6 +864,7 @@ create_msg_thread (gpointer thread_data)
                                                         info->html_body,
                                                         info->plain_body, info->attachments_list,
                                                         info->images_list, &attached,
+                                                        info->header_pairs,
                                                         &(priv->error));
        }
 
@@ -898,6 +902,7 @@ create_msg_thread (gpointer thread_data)
        g_list_free (info->attachments_list);
        g_list_foreach (info->images_list, (GFunc) g_object_unref, NULL);
        g_list_free (info->images_list);
+       g_object_unref (info->header_pairs);
 
        if (info->callback) {
                CreateMsgIdleInfo *idle_info;
@@ -929,6 +934,7 @@ modest_mail_operation_create_msg (ModestMailOperation *self,
                                  TnyHeaderFlags priority_flags,
                                  const gchar *references,
                                  const gchar *in_reply_to,
+                                 TnyList *header_pairs,
                                  ModestMailOperationCreateMsgCallback callback,
                                  gpointer userdata)
 {
@@ -951,6 +957,7 @@ modest_mail_operation_create_msg (ModestMailOperation *self,
        info->images_list = g_list_copy ((GList *) images_list);
        g_list_foreach (info->images_list, (GFunc) g_object_ref, NULL);
        info->priority_flags = 0 | priority_flags;
+       info->header_pairs = tny_list_copy (header_pairs);
 
        info->callback = callback;
        info->userdata = userdata;
@@ -1107,7 +1114,8 @@ modest_mail_operation_send_new_mail (ModestMailOperation *self,
                                     const GList *images_list,
                                     const gchar *references,
                                     const gchar *in_reply_to,
-                                    TnyHeaderFlags priority_flags)
+                                    TnyHeaderFlags priority_flags,
+                                    TnyList *header_pairs)
 {
        ModestMailOperationPrivate *priv = NULL;
        SendNewMailInfo *info;
@@ -1144,6 +1152,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,
+                                         header_pairs,
                                          modest_mail_operation_send_new_mail_cb, info);
 
 }
@@ -1375,6 +1384,7 @@ modest_mail_operation_save_to_drafts (ModestMailOperation *self,
                                      TnyHeaderFlags priority_flags,
                                      const gchar *references,
                                      const gchar *in_reply_to,
+                                     TnyList *header_pairs,
                                      SaveToDraftstCallback callback,
                                      gpointer user_data)
 {
@@ -1401,6 +1411,7 @@ modest_mail_operation_save_to_drafts (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,
+                                         header_pairs,
                                          modest_mail_operation_save_to_drafts_cb, info);
 }