[evolution-ews] Use only personal mail folders for change notification listener



commit e15b271131fc5a4501e30003b0d2da7aa80ce12d
Author: Milan Crha <mcrha redhat com>
Date:   Thu Aug 6 17:24:15 2015 +0200

    Use only personal mail folders for change notification listener
    
    Aka skip virtual, public and foreign folders from the list of
    folders to listen on, which is not allowed by the server anyway.

 src/camel/camel-ews-store.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/camel/camel-ews-store.c b/src/camel/camel-ews-store.c
index 8b38b3e..b0794d6 100644
--- a/src/camel/camel-ews-store.c
+++ b/src/camel/camel-ews-store.c
@@ -1091,7 +1091,14 @@ folder_ids_populate (CamelFolderInfo *folder_info,
                gchar *id;
 
                id = camel_ews_store_summary_get_folder_id_from_name (hnd->ews_store->summary, 
folder_info->full_name);
-               hnd->folders = g_slist_prepend (hnd->folders, id);
+               if (id && !g_str_has_prefix (id, "ForeignMailbox::") &&
+                   !g_str_equal (id, EWS_PUBLIC_FOLDER_ROOT_ID) &&
+                   !g_str_equal (id, EWS_FOREIGN_FOLDER_ROOT_ID) &&
+                   !camel_ews_store_summary_get_foreign (hnd->ews_store->summary, id, NULL) &&
+                   !camel_ews_store_summary_get_public (hnd->ews_store->summary, id, NULL))
+                       hnd->folders = g_slist_prepend (hnd->folders, id);
+               else
+                       g_free (id);
 
                if (folder_info->child != NULL)
                        folder_ids_populate (folder_info->child, hnd);


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