CreateMsgInfo *info = (CreateMsgInfo *) thread_data;
TnyMsg *new_msg = NULL;
ModestMailOperationPrivate *priv;
+ gint attached = 0;
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->attachments_list,
+ 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->plain_body, info->attachments_list,
- info->images_list,
+ info->images_list, &attached,
&(priv->error));
}
tny_header_set_flag (header, info->priority_flags);
/* Set attachment flags in message */
- if (info->attachments_list != NULL)
+ if (info->attachments_list != NULL && attached > 0)
tny_header_set_flag (header, TNY_HEADER_FLAG_ATTACHMENTS);
g_object_unref (G_OBJECT(header));
ModestTnyFolderRules rules = 0;
TnyAccount *dst_account = NULL;
gboolean leave_on_server;
+ ModestMailOperationState *state;
g_return_if_fail (self && MODEST_IS_MAIL_OPERATION (self));
g_return_if_fail (headers && TNY_IS_LIST (headers));
helper->delete = (leave_on_server) ? FALSE : delete_original;
modest_mail_operation_notify_start (self);
+
+ /* Start notifying progress */
+ state = modest_mail_operation_clone_state (self);
+ state->done = 0;
+ state->total = 0;
+ g_signal_emit (G_OBJECT (self), signals[PROGRESS_CHANGED_SIGNAL], 0, state, NULL);
+ g_slice_free (ModestMailOperationState, state);
+
tny_folder_transfer_msgs_async (src_folder,
helper->headers,
folder,