From f979f8fe68ff83103258cba5e8c89295f464994d Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Thu, 13 Dec 2007 13:42:23 +0000 Subject: [PATCH] * Expunge the messages of the local accounts when removing them to save disk space pmo-trunk-r3911 --- src/modest-mail-operation.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index 7c78ded..82f2bcf 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -2369,6 +2369,7 @@ modest_mail_operation_remove_msg (ModestMailOperation *self, gboolean expunge, leave_on_server; const gchar *account_name; TnyAccount *account; + ModestTransportStoreProtocol account_proto; tny_header_set_flag (header, TNY_HEADER_FLAG_DELETED); tny_header_set_flag (header, TNY_HEADER_FLAG_SEEN); @@ -2382,7 +2383,10 @@ modest_mail_operation_remove_msg (ModestMailOperation *self, modest_account_mgr_get_leave_on_server (modest_runtime_get_account_mgr (), account_name); - if (TNY_IS_CAMEL_POP_FOLDER (folder) && !leave_on_server) + account_proto = modest_protocol_info_get_transport_store_protocol (tny_account_get_proto (account)); + + if (((account_proto == MODEST_PROTOCOL_STORE_POP) && !leave_on_server) || + modest_tny_folder_is_remote_folder (folder) == FALSE) expunge = TRUE; else expunge = FALSE; @@ -2479,6 +2483,7 @@ modest_mail_operation_remove_msgs (ModestMailOperation *self, gboolean expunge, leave_on_server; const gchar *account_name; TnyAccount *account; + ModestTransportStoreProtocol account_proto; account = tny_folder_get_account (folder); account_name = modest_tny_account_get_parent_modest_account_name_for_server_account (account); @@ -2486,7 +2491,10 @@ modest_mail_operation_remove_msgs (ModestMailOperation *self, modest_account_mgr_get_leave_on_server (modest_runtime_get_account_mgr (), account_name); - if (TNY_IS_CAMEL_POP_FOLDER (folder) && !leave_on_server) + account_proto = modest_protocol_info_get_transport_store_protocol (tny_account_get_proto (account)); + + if (((account_proto == MODEST_PROTOCOL_STORE_POP) && !leave_on_server) || + modest_tny_folder_is_remote_folder (folder) == FALSE) expunge = TRUE; else expunge = FALSE; -- 1.7.9.5