[evolution-data-server] Bug #652914 - IMAP: moving mail puts a copy into real Trash too



commit 57c4e94abac342e111c1cfba5fb81c1a4d8b20c4
Author: Milan Crha <mcrha redhat com>
Date:   Wed Aug 24 13:38:14 2011 +0200

    Bug #652914 - IMAP: moving mail puts a copy into real Trash too
    
    Also fixes issue when CamelSettings are populated too late for
    the initable.

 camel/camel-service.c                    |    1 +
 camel/providers/imap/camel-imap-folder.c |   10 +++++++++-
 2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 03b03b8..e761d5b 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -908,6 +908,7 @@ camel_service_set_settings (CamelService *service,
 				class->settings_type,
 				CAMEL_TYPE_SETTINGS));
 		settings = g_object_new (class->settings_type, NULL);
+		camel_settings_load_from_url (settings, camel_service_get_camel_url (service));
 	}
 
 	if (service->priv->settings != NULL)
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index b7b65b7..b32969b 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -2865,7 +2865,7 @@ do_copy (CamelFolder *source,
 			camel_imap_response_free (store, response);
 		}
 
-		if (local_error == NULL && delete_originals) {
+		if (local_error == NULL && delete_originals && (mark_moved || !trash_path)) {
 			for (i = last; i < uid; i++) {
 				camel_folder_delete_message (
 					source, uids->pdata[i]);
@@ -2886,6 +2886,14 @@ do_copy (CamelFolder *source,
 		return FALSE;
 	}
 
+	/* There is a real trash folder set, which is not on a google account
+	   and copied messages should be deleted, thus do not move them into
+	   a trash folder, but just expunge them, because the copy part of
+	   the operation was successful.
+	*/
+	if (trash_path && !mark_moved && delete_originals)
+		camel_imap_expunge_uids_only (source, uids, cancellable, NULL);
+
 	return TRUE;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]