[evolution-data-server] Bug 749664 - [IMAPx] Don't mark mail in trash folder as deleted
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug 749664 - [IMAPx] Don't mark mail in trash folder as deleted
- Date: Tue, 26 May 2015 19:57:50 +0000 (UTC)
commit 8811085cf4131d4736a220ae01e862590a0bdda1
Author: Milan Crha <mcrha redhat com>
Date: Tue May 26 21:55:59 2015 +0200
Bug 749664 - [IMAPx] Don't mark mail in trash folder as deleted
camel/providers/imapx/camel-imapx-folder.c | 8 ++++----
camel/providers/imapx/camel-imapx-server.c | 7 ++++++-
camel/providers/imapx/camel-imapx-server.h | 1 +
3 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-folder.c b/camel/providers/imapx/camel-imapx-folder.c
index 5d4c2ba..7644dea 100644
--- a/camel/providers/imapx/camel-imapx-folder.c
+++ b/camel/providers/imapx/camel-imapx-folder.c
@@ -967,7 +967,7 @@ imapx_move_to_real_junk (CamelIMAPXServer *imapx_server,
success = camel_imapx_server_copy_message (
imapx_server,
mailbox, destination,
- uids_to_copy, TRUE,
+ uids_to_copy, TRUE, FALSE,
cancellable, error);
*out_need_to_expunge = success;
} else {
@@ -1062,7 +1062,7 @@ imapx_move_to_real_trash (CamelIMAPXServer *imapx_server,
success = camel_imapx_server_copy_message (
imapx_server,
mailbox, destination,
- uids_to_copy, TRUE,
+ uids_to_copy, TRUE, TRUE,
cancellable, error);
*out_need_to_expunge = success;
} else {
@@ -1295,7 +1295,7 @@ imapx_transfer_messages_to_sync (CamelFolder *source,
success = camel_imapx_server_copy_message (
imapx_server, src_mailbox, dst_mailbox, uids,
- delete_originals, cancellable, &local_error);
+ delete_originals, FALSE, cancellable, &local_error);
camel_imapx_store_folder_op_done (imapx_store, imapx_server, folder_name);
@@ -1307,7 +1307,7 @@ imapx_transfer_messages_to_sync (CamelFolder *source,
if (imapx_server) {
success = camel_imapx_server_copy_message (
imapx_server, src_mailbox, dst_mailbox, uids,
- delete_originals, cancellable, &local_error);
+ delete_originals, FALSE, cancellable, &local_error);
camel_imapx_store_folder_op_done (imapx_store, imapx_server, folder_name);
}
diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c
index 641c733..1922e70 100644
--- a/camel/providers/imapx/camel-imapx-server.c
+++ b/camel/providers/imapx/camel-imapx-server.c
@@ -146,6 +146,7 @@ struct _CopyMessagesData {
GPtrArray *uids;
gboolean delete_originals;
gboolean use_move_command;
+ gboolean remove_deleted_flags;
gint index;
gint last_index;
struct _uidset_state uidset;
@@ -5439,6 +5440,8 @@ imapx_command_copy_messages_step_done (CamelIMAPXServer *is,
TRUE,
((CamelMessageInfoBase *) source_info)->user_tags,
camel_imapx_mailbox_get_permanentflags (data->destination));
+ if (data->remove_deleted_flags)
+ camel_message_info_set_flags (destination_info,
CAMEL_MESSAGE_DELETED, 0);
if (is_new)
camel_folder_summary_add (destination->summary, destination_info);
camel_folder_change_info_add_uid (changes, destination_info->uid);
@@ -8609,6 +8612,7 @@ camel_imapx_server_copy_message (CamelIMAPXServer *is,
CamelIMAPXMailbox *destination,
GPtrArray *uids,
gboolean delete_originals,
+ gboolean remove_deleted_flags,
GCancellable *cancellable,
GError **error)
{
@@ -8633,6 +8637,7 @@ camel_imapx_server_copy_message (CamelIMAPXServer *is,
data->destination = g_object_ref (destination);
data->uids = g_ptr_array_new ();
data->delete_originals = delete_originals;
+ data->remove_deleted_flags = remove_deleted_flags;
/* If we're moving messages, prefer "UID MOVE" if supported. */
if (data->delete_originals) {
@@ -9036,7 +9041,7 @@ imapx_server_sync_changes (CamelIMAPXServer *is,
camel_imapx_settings_get_use_real_trash_path (settings);
g_object_unref (settings);
- remove_deleted_flags = use_real_trash_path && (job_type != IMAPX_JOB_EXPUNGE) != 0;
+ remove_deleted_flags = use_real_trash_path && job_type != IMAPX_JOB_EXPUNGE;
off_orset = on_orset = 0;
for (i = 0; i < changed_uids->len; i++) {
diff --git a/camel/providers/imapx/camel-imapx-server.h b/camel/providers/imapx/camel-imapx-server.h
index 448b813..bf34d4c 100644
--- a/camel/providers/imapx/camel-imapx-server.h
+++ b/camel/providers/imapx/camel-imapx-server.h
@@ -200,6 +200,7 @@ gboolean camel_imapx_server_copy_message (CamelIMAPXServer *is,
CamelIMAPXMailbox *destination,
GPtrArray *uids,
gboolean delete_originals,
+ gboolean remove_deleted_flags,
GCancellable *cancellable,
GError **error);
gboolean camel_imapx_server_append_message
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]