const GList *images_list,
TnyHeaderFlags priority_flags,
const gchar *references, const gchar *in_reply_to,
+ TnyList *header_pairs,
ModestMailOperationCreateMsgCallback callback,
gpointer userdata);
GList *attachments_list;
GList *images_list;
TnyHeaderFlags priority_flags;
+ TnyList *header_pairs;
ModestMailOperationCreateMsgCallback callback;
gpointer userdata;
} CreateMsgInfo;
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,
info->html_body,
info->plain_body, info->attachments_list,
info->images_list, &attached,
+ info->header_pairs,
&(priv->error));
}
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;
TnyHeaderFlags priority_flags,
const gchar *references,
const gchar *in_reply_to,
+ TnyList *header_pairs,
ModestMailOperationCreateMsgCallback callback,
gpointer userdata)
{
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;
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;
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);
}
TnyHeaderFlags priority_flags,
const gchar *references,
const gchar *in_reply_to,
+ TnyList *header_pairs,
SaveToDraftstCallback callback,
gpointer user_data)
{
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);
}
const GList *images_list,
const gchar *references,
const gchar *in_reply_to,
- TnyHeaderFlags priority_flags);
+ TnyHeaderFlags priority_flags,
+ TnyList *header_pairs);
/**
TnyHeaderFlags priority_flags,
const gchar *references,
const gchar *in_reply_to,
+ TnyList *header_pairs,
SaveToDraftstCallback callback,
gpointer user_data);
/**
static TnyMimePart* modest_tny_msg_find_body_part_from_mime_part (TnyMimePart *msg, gboolean want_html);
static TnyMimePart* modest_tny_msg_find_calendar_from_mime_part (TnyMimePart *msg);
+static void
+add_header_pairs (TnyMimePart *part, TnyList *header_pairs)
+{
+ TnyIterator *iterator;
+
+ iterator = tny_list_create_iterator (header_pairs);
+ while (!tny_iterator_is_done (iterator)) {
+ TnyPair *current = (TnyPair *) tny_iterator_get_current (iterator);
+ tny_mime_part_set_header_pair (part, tny_pair_get_name (current), tny_pair_get_value (current));
+ g_object_unref (current);
+ tny_iterator_next (iterator);
+ }
+ g_object_unref (iterator);
+}
+
TnyMsg*
modest_tny_msg_new (const gchar* mailto, const gchar* from, const gchar *cc,
const gchar *bcc, const gchar* subject,
const gchar *references, const gchar *in_reply_to,
const gchar *body,
- GList *attachments, gint *attached, GError **err)
+ GList *attachments, gint *attached, TnyList *header_pairs, GError **err)
{
TnyMsg *new_msg;
TnyHeader *header;
/* Create new msg */
new_msg = modest_formatter_create_message (NULL, TRUE, (attachments != NULL), FALSE);
+ add_header_pairs (TNY_MIME_PART (new_msg), header_pairs);
header = tny_msg_get_header (new_msg);
if ((from != NULL) && (strlen(from) > 0)) {
const gchar *bcc, const gchar* subject,
const gchar *references, const gchar *in_reply_to,
const gchar *html_body, const gchar *plain_body,
- GList *attachments, GList *images, gint *attached, GError **err)
+ GList *attachments, GList *images, gint *attached, TnyList *header_pairs, GError **err)
{
TnyMsg *new_msg;
TnyHeader *header;
/* Create new msg */
new_msg = modest_formatter_create_message (NULL, FALSE, (attachments != NULL), (images != NULL));
+ add_header_pairs (TNY_MIME_PART (new_msg), header_pairs);
header = tny_msg_get_header (new_msg);
if ((from != NULL) && (strlen(from) > 0)) {
const gchar *bcc, const gchar* subject,
const gchar *references, const gchar *in_reply_to,
const gchar *body,
- GList *attachments, gint *attached, GError **err);
+ GList *attachments, gint *attached, TnyList *header_pairs, GError **err);
/**
* modest_tny_msg_new_html_plain:
const gchar *bcc, const gchar* subject,
const gchar *references, const gchar *in_reply_to,
const gchar *html_body, const gchar *plain_body,
- GList *attachments, GList *images, gint *attached, GError **err);
+ GList *attachments, GList *images, gint *attached, TnyList *header_pairs, GError **err);
/**
* modest_tny_msg_find_body_part:
GnomeVFSFileSize total_size, allowed_size;
guint64 available_disk, expected_size, parts_size;
guint parts_count;
+ TnyList *header_pairs;
/* we check for low-mem */
if (modest_platform_check_memory_low (win, TRUE))
body = use_signature ? g_strconcat ((body_str) ? body_str : "", signature, NULL) :
g_strdup(body_str);
+ header_pairs = TNY_LIST (tny_simple_list_new ());
msg = modest_tny_msg_new_html_plain (to_str, from_str, cc_str, bcc_str, subject_str,
- NULL, NULL, body, NULL, NULL, NULL, NULL, NULL);
+ NULL, NULL, body, NULL, NULL, NULL, NULL, header_pairs, NULL);
+ g_object_unref (header_pairs);
+
if (!msg) {
g_printerr ("modest: failed to create new msg\n");
goto cleanup;
gboolean use_signature;
TnyMsg *new_msg;
GtkWidget *msg_win;
- gdouble parent_zoom;
const gchar *account_name;
const gchar *mailbox;
TnyHeader *msg_header;
mgr = modest_runtime_get_window_mgr ();
modest_window_mgr_register_window (mgr, MODEST_WINDOW (msg_win), (ModestWindow *) win);
- parent_zoom = modest_window_get_zoom (MODEST_WINDOW (win));
- modest_window_set_zoom (MODEST_WINDOW (msg_win), parent_zoom);
-
/* Show edit window */
gtk_widget_show_all (GTK_WIDGET (msg_win));
data->priority_flags,
data->references,
data->in_reply_to,
+ data->custom_header_pairs,
on_save_to_drafts_cb,
g_object_ref(edit_window));
data->images,
data->references,
data->in_reply_to,
- data->priority_flags);
+ data->priority_flags,
+ data->custom_header_pairs);
if (modest_mail_operation_get_status (mail_operation) == MODEST_MAIL_OPERATION_STATUS_IN_PROGRESS)
modest_platform_information_banner (NULL, NULL, _("mcen_ib_outbox_waiting_to_be_sent"));
TnyFolder *msg_folder;
gboolean is_html = FALSE;
gboolean field_view_set;
+ TnyList *orig_header_pairs;
g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (self));
g_return_if_fail (TNY_IS_MSG (msg));
g_object_unref (msg_folder);
}
+ orig_header_pairs = TNY_LIST (tny_simple_list_new ());
+ tny_mime_part_get_header_pairs (TNY_MIME_PART (msg), orig_header_pairs);
+ modest_msg_edit_window_set_custom_header_pairs (self, orig_header_pairs);
+ g_object_unref (orig_header_pairs);
+
g_free (to);
g_free (subject);
g_free (cc);
"horizontal-max-overshoot", 0,
NULL);
gtk_container_add (GTK_CONTAINER (priv->main_scroll), priv->msg_view);
+ g_object_ref (priv->msg_view);
gtk_box_pack_start (GTK_BOX(main_vbox), priv->main_scroll, TRUE, TRUE, 0);
gtk_container_add (GTK_CONTAINER(obj), main_vbox);
/* Sanity check: shouldn't be needed, the window mgr should
call this function before */
modest_msg_view_window_disconnect_signals (MODEST_WINDOW (obj));
+ g_object_unref (priv->msg_view);
if (priv->fetch_image_redraw_handler > 0) {
g_source_remove (priv->fetch_image_redraw_handler);