[evolution-ews] I#60 - Messages deleted in public folders cannot be moved to Deleted Items
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-ews] I#60 - Messages deleted in public folders cannot be moved to Deleted Items
- Date: Mon, 26 Aug 2019 14:53:28 +0000 (UTC)
commit 7e6b2f7acebca558b4825af6699a1318ea10e578
Author: Milan Crha <mcrha redhat com>
Date: Mon Aug 26 16:52:25 2019 +0200
I#60 - Messages deleted in public folders cannot be moved to Deleted Items
Closes https://gitlab.gnome.org/GNOME/evolution-ews/issues/60
src/camel/camel-ews-folder.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
---
diff --git a/src/camel/camel-ews-folder.c b/src/camel/camel-ews-folder.c
index 7fdafd18..8f6edbd8 100644
--- a/src/camel/camel-ews-folder.c
+++ b/src/camel/camel-ews-folder.c
@@ -1512,6 +1512,29 @@ ews_folder_is_of_type (CamelFolder *folder,
return is_of_type;
}
+static gboolean
+ews_folder_is_public_or_foreign (CamelFolder *folder)
+{
+ CamelStore *parent_store;
+ CamelEwsStore *ews_store;
+ gboolean res;
+ gchar *folder_id;
+
+ g_return_val_if_fail (folder != NULL, FALSE);
+
+ parent_store = camel_folder_get_parent_store (folder);
+ ews_store = CAMEL_EWS_STORE (parent_store);
+
+ g_return_val_if_fail (ews_store != NULL, FALSE);
+
+ folder_id = camel_ews_store_summary_get_folder_id_from_name (ews_store->summary,
camel_folder_get_full_name (folder));
+ res = folder_id && (camel_ews_store_summary_get_public (ews_store->summary, folder_id, NULL) ||
+ camel_ews_store_summary_get_foreign (ews_store->summary, folder_id, NULL));
+ g_free (folder_id);
+
+ return res;
+}
+
static gboolean
ews_move_to_special_folder (CamelFolder *folder,
const GSList *uids,
@@ -2765,6 +2788,9 @@ ews_delete_messages (CamelFolder *folder,
if (!camel_ews_store_connected (ews_store, cancellable, error))
return FALSE;
+ if (!expunge)
+ expunge = ews_folder_is_public_or_foreign (folder);
+
ews_delete_messages_from_server (
ews_store,
deleted_items,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]