gboolean has_attachments);
-static void modest_mail_operation_xfer_folder (ModestMailOperation *self,
- TnyFolder *folder,
- TnyFolderStore *parent,
- gboolean delete_original);
+static void modest_mail_operation_xfer_folder (ModestMailOperation *self,
+ TnyFolder *folder,
+ TnyFolderStore *parent,
+ gboolean delete_original);
static gboolean modest_mail_operation_xfer_msg (ModestMailOperation *self,
TnyHeader *header,
TnyMimePart *body;
ModestFormatter *formatter;
- /* Get body from original msg */
+ /* Get body from original msg. Always look for the text/plain
+ part of the message to create the reply/forwarded mail */
header = tny_msg_get_header (msg);
- body = modest_tny_msg_actions_find_body_part (msg, TRUE);
+ body = modest_tny_msg_actions_find_body_part (msg, FALSE);
/* TODO: select the formatter from account prefs */
formatter = modest_formatter_new ("text/plain");
TnyMsg *new_msg;
TnyHeader *new_header, *header;
const gchar* reply_to;
+ gchar *new_cc = NULL;
+ const gchar *cc = NULL, *bcc = NULL;
+ GString *tmp = NULL;
new_msg = create_reply_forward_mail (msg, from, TRUE, reply_type);
tny_header_set_to (new_header, tny_header_get_from (header));
switch (reply_mode) {
- gchar *new_cc = NULL;
- const gchar *cc = NULL, *bcc = NULL;
- GString *tmp = NULL;
-
case MODEST_MAIL_OPERATION_REPLY_MODE_SENDER:
/* Do not fill neither cc nor bcc */
break;
if (priv->done == priv->total)
priv->status = MODEST_MAIL_OPERATION_STATUS_SUCCESS;
- else if ((priv->done + helper->canceled + helper->failed) == priv->total)
+ else if ((priv->done + helper->canceled + helper->failed) == priv->total) {
if (helper->failed == priv->total)
priv->status = MODEST_MAIL_OPERATION_STATUS_FAILED;
else if (helper->failed == priv->total)
priv->status = MODEST_MAIL_OPERATION_STATUS_CANCELED;
else
priv->status = MODEST_MAIL_OPERATION_STATUS_FINISHED_WITH_ERRORS;
-
+ }
tny_iterator_next (helper->iter);
if (tny_iterator_is_done (helper->iter)) {
TnyList *list;
{
ModestMailOperation *self;
ModestMailOperationPrivate *priv;
- TnyList *folders;
RefreshFolderAsyncHelper *helper;
self = MODEST_MAIL_OPERATION (user_data);
store_account = TNY_STORE_ACCOUNT (tny_folder_get_account (folder));
trash_folder = modest_mail_operation_find_trash_folder (self, store_account);
- modest_mail_operation_move_msg (self, header, trash_folder);
+ if (trash_folder) {
+ modest_mail_operation_move_msg (self, header, trash_folder);
+/* g_object_unref (trash_folder); */
+ } else {
+ ModestMailOperationPrivate *priv;
+
+ /* Set status failed and set an error */
+ priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self);
+ priv->status = MODEST_MAIL_OPERATION_STATUS_FAILED;
+ g_set_error (&(priv->error), MODEST_MAIL_OPERATION_ERROR,
+ MODEST_MAIL_OPERATION_ERROR_ITEM_NOT_FOUND,
+ _("Error trying to delete a message. Trash folder not found"));
+ }
g_object_unref (G_OBJECT (store_account));
} else {
return g_string_free(type, FALSE);
}
-static GQuark
-modest_error_quark (void)
-{
- static GQuark err_q = 0;
-
- if (err_q == 0)
- err_q = g_quark_from_static_string ("modest-error-quark");
-
- return err_q;
-}
-
static void
add_attachments (TnyMsg *msg, GList *attachments_list)
{